Comments (4)
代码截一下,看视频我也不知道为啥
from mind-map.
<template>
<el-dialog class="nodeImportDialog" title="预览" :visible.sync="dialogVisible" width="800px">
<div id="mindMapContainer1" ref="mindMapContainerRef"></div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">{{ $t('dialog.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { getData } from '@/api';
import MindMap from 'simple-mind-map';
export default {
name: 'Import',
data() {
return {
dialogVisible: false,
mindMapData: null,
}
},
watch: {
dialogVisible(val, oldVal) {
if (val) {
setTimeout(() => {
this.getData()
this.init()
}, 100)
}
}
},
created() {
this.$bus.$on('showPreview', this.handleShowPreview)
},
mounted() {
this.getData()
},
beforeDestroy() {
this.$bus.$off('showPreview', this.handleShowPreview)
},
methods: {
getData() {
let storeData = getData()
this.mindMapData = storeData
},
handleClose() {
this.dialogVisible = false
},
handleShowPreview() {
this.dialogVisible = true
},
/**
* @Author: 王林
* @Date: 2021-04-10 15:01:01
* @Desc: 初始化
*/
init() {
let { root, layout, theme, view, config } = this.mindMapData
// 如果url中存在要打开的文件,那么思维导图数据、主题、布局都使用默认的
this.mindMap = new MindMap({
el: this.$refs.mindMapContainerRef,
data: root,
fit: false,
layout: layout,
theme: theme.template,
themeConfig: theme.config,
viewData: view,
nodeTextEditZIndex: 1000,
nodeNoteTooltipZIndex: 1000,
...(config || {}),
// useLeftKeySelectionRightKeyDrag: this.useLeftKeySelectionRightKeyDrag,
customInnerElsAppendTo: null,
enableAutoEnterTextEditWhenKeydown: true,
defaultNodeImage: require('../../../assets/img/图片加载失败.svg'),
initRootNodePosition: ['center', 'center'],
})
},
},
}
</script>
<style lang="less" scoped>
.nodeImportDialog {
#mindMapContainer1 {
// position: absolute;
width: 100%;
height: 600px;
}
}
</style>
from mind-map.
是个bug,下个版本会修复
from mind-map.
已修复,v0.9.11+生效,也可以拉取feature分支获取最新的代码
from mind-map.
Related Issues (20)
- 如果设置新建节点仅激活,并监听了激活前事件,当用tab键新建,未触发before_node_active回调 HOT 1
- 当节点内容有图标&&换行符号时候,展开收起节点会导致样式错误 HOT 4
- 教程里新增完整的创建节点的参数示例
- 功能建议:希望桌面版能加一个WebDav用于数据同步 HOT 1
- [bug]在使用方向键切换时无法保持原有缩放 HOT 1
- 自定义的隐藏无法响应 HOT 1
- 运行demo项目,提示XSS工具方法缺失 HOT 2
- 自定义节点问题 HOT 3
- 当思维导图在渲染过程中,此时重新渲染,可能导致思维导图样式错乱 HOT 9
- 技术请教,怎么保证渲染的图形不重叠的 HOT 2
- 导入MD文档时,如果对应行开始有双星号加粗会渲染成undefine,如果对应行开始有"<"号,则会渲染成空白 HOT 3
- 【使用体验】与【功能请求】:关于 样式、结构 HOT 1
- 在‘data_change_detail’事件中,如果进行了删除、新增操作,返回的更改数据列表有误 HOT 1
- 项目demo中的协同打开后 被操作的节点不能显示用户信息
- 支持设置水印的层级
- [Bug] 编程插入节点,和插入顺序不一致
- 问题反馈:如果节点的子节点都是同一个节点(id相同),连线排版问题不太好看 HOT 2
- 复制带换行符的节点内容并在记事本上粘贴后会多出空行
- 建议增强节点数学公式可修改性 HOT 1
- 移动端不能进行画布手势缩放吗
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mind-map.