mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
Demo:导入了富文本内容自动开启富文本模式设置
This commit is contained in:
parent
9b2c9ad1d2
commit
d3353d50c5
@ -331,7 +331,8 @@ export default {
|
||||
no: 'No',
|
||||
exportError: 'Export failed',
|
||||
dragTip: 'Release here to import the file',
|
||||
deleteNodeImgTip: 'Are you sure to delete the node image?'
|
||||
deleteNodeImgTip: 'Are you sure to delete the node image?',
|
||||
autoOpenNodeRichTextTip: 'Detected imported rich text content, automatically enabled rich text mode'
|
||||
},
|
||||
mouseAction: {
|
||||
tip1:
|
||||
|
||||
@ -323,7 +323,8 @@ export default {
|
||||
no: '否',
|
||||
exportError: '导出失败',
|
||||
dragTip: '在此释放以导入该文件',
|
||||
deleteNodeImgTip: '是否确认删除该节点图片?'
|
||||
deleteNodeImgTip: '是否确认删除该节点图片?',
|
||||
autoOpenNodeRichTextTip: '检测到导入了富文本内容,已自动开启富文本模式'
|
||||
},
|
||||
mouseAction: {
|
||||
tip1: '当前:左键拖动画布,右键框选节点',
|
||||
|
||||
@ -322,7 +322,8 @@ export default {
|
||||
yes: '是',
|
||||
no: '否',
|
||||
exportError: '匯出失敗',
|
||||
dragTip: '在此釋放以匯入檔案'
|
||||
dragTip: '在此釋放以匯入檔案',
|
||||
autoOpenNodeRichTextTip: '檢測到導入了富文本內容,已自動開啓富文本模式'
|
||||
},
|
||||
mouseAction: {
|
||||
tip1: '目前:左鍵拖曳畫布,右鍵框選節點',
|
||||
|
||||
@ -654,13 +654,24 @@ export default {
|
||||
// 动态设置思维导图数据
|
||||
setData(data) {
|
||||
this.handleShowLoading()
|
||||
let rootNodeData = null
|
||||
if (data.root) {
|
||||
this.mindMap.setFullData(data)
|
||||
rootNodeData = data.root
|
||||
} else {
|
||||
this.mindMap.setData(data)
|
||||
rootNodeData = data
|
||||
}
|
||||
this.mindMap.view.reset()
|
||||
this.manualSave()
|
||||
// 如果导入的是富文本内容,那么自动开启富文本模式
|
||||
if (rootNodeData.data.richText && !this.openNodeRichText) {
|
||||
this.$bus.$emit('toggleOpenNodeRichText', true)
|
||||
this.$notify.info({
|
||||
title: this.$t('edit.tip'),
|
||||
message: this.$t('edit.autoOpenNodeRichTextTip')
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 重新渲染
|
||||
|
||||
@ -417,8 +417,11 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.initLoacalConfig()
|
||||
this.$bus.$on('toggleOpenNodeRichText', this.onToggleOpenNodeRichText)
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$bus.$off('toggleOpenNodeRichText', this.onToggleOpenNodeRichText)
|
||||
},
|
||||
beforeDestroy() {},
|
||||
methods: {
|
||||
...mapMutations(['setLocalConfig']),
|
||||
|
||||
@ -520,6 +523,13 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
onToggleOpenNodeRichText(val) {
|
||||
this.setLocalConfig({
|
||||
openNodeRichText: val
|
||||
})
|
||||
this.enableNodeRichText = val
|
||||
},
|
||||
|
||||
// 本地配置
|
||||
updateLocalConfig(key, value) {
|
||||
this.setLocalConfig({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user