mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 22:08:25 +08:00
Demo:支持从右键菜单删除节点的超链接,备注
This commit is contained in:
@@ -1087,7 +1087,8 @@ class Render {
|
||||
}
|
||||
|
||||
// 设置节点图片
|
||||
setNodeImage(node, { url, title, width, height, custom = false }) {
|
||||
setNodeImage(node, data) {
|
||||
const { url, title, width, height, custom = false } = data || { url: '', title: '', width: 0, height: 0, custom: false }
|
||||
this.setNodeDataRender(node, {
|
||||
image: url,
|
||||
imageTitle: title || '',
|
||||
|
||||
@@ -77,7 +77,10 @@ export default {
|
||||
level5: 'Level5',
|
||||
level6: 'Level6',
|
||||
zenMode: 'Zen mode',
|
||||
fitCanvas: 'Fit canvas'
|
||||
fitCanvas: 'Fit canvas',
|
||||
removeImage: 'Remove image',
|
||||
removeHyperlink: 'Remove hyperlink',
|
||||
removeNote: 'Remove note'
|
||||
},
|
||||
count: {
|
||||
words: 'Words',
|
||||
|
||||
@@ -77,7 +77,10 @@ export default {
|
||||
level5: '五级主题',
|
||||
level6: '六级主题',
|
||||
zenMode: '禅模式',
|
||||
fitCanvas: '适应画布'
|
||||
fitCanvas: '适应画布',
|
||||
removeImage: '移除图片',
|
||||
removeHyperlink: '移除超链接',
|
||||
removeNote: '移除备注'
|
||||
},
|
||||
count: {
|
||||
words: '字数',
|
||||
|
||||
@@ -70,6 +70,12 @@
|
||||
{{ $t('contextmenu.pasteNode') }}
|
||||
<span class="desc">Ctrl + V</span>
|
||||
</div>
|
||||
<div class="item" @click="exec('REMOVE_HYPERLINK')" v-if="hasHyperlink">
|
||||
{{ $t('contextmenu.removeHyperlink') }}
|
||||
</div>
|
||||
<div class="item" @click="exec('REMOVE_NOTE')" v-if="hasNote">
|
||||
{{ $t('contextmenu.removeNote') }}
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="type === 'svg'">
|
||||
<div class="item" @click="exec('RETURN_CENTER')">
|
||||
@@ -180,6 +186,12 @@ export default {
|
||||
},
|
||||
isGeneralization() {
|
||||
return this.node.isGeneralization
|
||||
},
|
||||
hasHyperlink() {
|
||||
return !!this.node.getData('hyperlink')
|
||||
},
|
||||
hasNote() {
|
||||
return !!this.node.getData('note')
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -302,6 +314,12 @@ export default {
|
||||
case 'FIT_CANVAS':
|
||||
this.mindMap.view.fit()
|
||||
break
|
||||
case 'REMOVE_HYPERLINK':
|
||||
this.node.setHyperlink('', '')
|
||||
break
|
||||
case 'REMOVE_NOTE':
|
||||
this.node.setNote('')
|
||||
break
|
||||
default:
|
||||
this.$bus.$emit('execCommand', key, ...args)
|
||||
break
|
||||
|
||||
@@ -105,12 +105,7 @@ export default {
|
||||
if (!this.img && !this.imgUrl) {
|
||||
this.cancel()
|
||||
this.activeNodes.forEach(node => {
|
||||
node.setImage({
|
||||
url: '',
|
||||
title: '',
|
||||
width: 0,
|
||||
height: 0
|
||||
})
|
||||
node.setImage(null)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user