mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-20 18:26:37 +08:00
add toolbar for markmap component
This commit is contained in:
parent
d87f09c957
commit
3eef9a836b
@ -3,6 +3,7 @@
|
|||||||
## v4.0.6
|
## v4.0.6
|
||||||
|
|
||||||
* Bug修复:修复PC端画廊页面的瀑布流组件样式错乱问题
|
* Bug修复:修复PC端画廊页面的瀑布流组件样式错乱问题
|
||||||
|
* 功能新增:给思维导图增加 ToolBar,实现思维导图的放大缩小和定位
|
||||||
|
|
||||||
## v4.0.5
|
## v4.0.5
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
"markdown-it-mathjax": "^2.0.0",
|
"markdown-it-mathjax": "^2.0.0",
|
||||||
"markmap-common": "^0.16.0",
|
"markmap-common": "^0.16.0",
|
||||||
"markmap-lib": "^0.16.1",
|
"markmap-lib": "^0.16.1",
|
||||||
|
"markmap-toolbar": "^0.17.0",
|
||||||
"markmap-view": "^0.16.0",
|
"markmap-view": "^0.16.0",
|
||||||
"md-editor-v3": "^2.2.1",
|
"md-editor-v3": "^2.2.1",
|
||||||
"mitt": "^3.0.1",
|
"mitt": "^3.0.1",
|
||||||
|
@ -117,6 +117,7 @@
|
|||||||
display flex
|
display flex
|
||||||
justify-content center
|
justify-content center
|
||||||
align-items center
|
align-items center
|
||||||
|
position relative
|
||||||
|
|
||||||
.markmap {
|
.markmap {
|
||||||
width 100%
|
width 100%
|
||||||
@ -127,6 +128,27 @@
|
|||||||
//height 30px
|
//height 30px
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#toolbar {
|
||||||
|
position: absolute
|
||||||
|
bottom: 10px
|
||||||
|
right: 20px
|
||||||
|
|
||||||
|
.mm-toolbar {
|
||||||
|
display flex
|
||||||
|
flex-flow row
|
||||||
|
|
||||||
|
.mm-toolbar-brand {
|
||||||
|
display none
|
||||||
|
}
|
||||||
|
|
||||||
|
.mm-toolbar-item {
|
||||||
|
cursor pointer
|
||||||
|
color var(--el-color-white)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,10 +81,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="markdown" v-if="loading">
|
<div class="markdown" v-if="loading">
|
||||||
<div v-html="html"></div>
|
<div :style="{ height: rightBoxHeight + 'px', overflow:'auto' }" v-html="html"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="body" id="markmap" v-show="!loading">
|
<div class="body" id="markmap" v-show="!loading">
|
||||||
<svg ref="svgRef" :style="{ height: rightBoxHeight + 'px' }"/>
|
<svg ref="svgRef" :style="{ height: rightBoxHeight + 'px' }"/>
|
||||||
|
<div id="toolbar"></div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- end task list box -->
|
</div><!-- end task list box -->
|
||||||
</div>
|
</div>
|
||||||
@ -104,6 +105,7 @@ import {checkSession} from "@/action/session";
|
|||||||
import {httpGet} from "@/utils/http";
|
import {httpGet} from "@/utils/http";
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
import {Download} from "@element-plus/icons-vue";
|
import {Download} from "@element-plus/icons-vue";
|
||||||
|
import {Toolbar} from 'markmap-toolbar';
|
||||||
|
|
||||||
const leftBoxHeight = ref(window.innerHeight - 105)
|
const leftBoxHeight = ref(window.innerHeight - 105)
|
||||||
const rightBoxHeight = ref(window.innerHeight - 85)
|
const rightBoxHeight = ref(window.innerHeight - 85)
|
||||||
@ -140,6 +142,8 @@ onMounted(() => {
|
|||||||
initData()
|
initData()
|
||||||
try {
|
try {
|
||||||
markMap.value = Markmap.create(svgRef.value)
|
markMap.value = Markmap.create(svgRef.value)
|
||||||
|
const {el} = Toolbar.create(markMap.value);
|
||||||
|
document.getElementById('toolbar').append(el);
|
||||||
update()
|
update()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
|
Loading…
Reference in New Issue
Block a user