Demo:节点右键菜单新增导出为图片按钮
This commit is contained in:
parent
e072dcb170
commit
6b40358f65
@ -98,7 +98,8 @@ export default {
|
|||||||
removeHyperlink: 'Remove hyperlink',
|
removeHyperlink: 'Remove hyperlink',
|
||||||
removeNote: 'Remove note',
|
removeNote: 'Remove note',
|
||||||
removeCustomStyles: 'Remove custom styles',
|
removeCustomStyles: 'Remove custom styles',
|
||||||
removeAllNodeCustomStyles: 'Remove all node custom styles'
|
removeAllNodeCustomStyles: 'Remove all node custom styles',
|
||||||
|
exportNodeToPng: 'Export node to png'
|
||||||
},
|
},
|
||||||
count: {
|
count: {
|
||||||
words: 'Words',
|
words: 'Words',
|
||||||
|
|||||||
@ -98,7 +98,8 @@ export default {
|
|||||||
removeHyperlink: '移除超链接',
|
removeHyperlink: '移除超链接',
|
||||||
removeNote: '移除备注',
|
removeNote: '移除备注',
|
||||||
removeCustomStyles: '一键去除自定义样式',
|
removeCustomStyles: '一键去除自定义样式',
|
||||||
removeAllNodeCustomStyles: '一键去除所有节点自定义样式'
|
removeAllNodeCustomStyles: '一键去除所有节点自定义样式',
|
||||||
|
exportNodeToPng: '导出该节点为图片'
|
||||||
},
|
},
|
||||||
count: {
|
count: {
|
||||||
words: '字数',
|
words: '字数',
|
||||||
|
|||||||
@ -91,6 +91,9 @@
|
|||||||
<div class="item" @click="exec('REMOVE_CUSTOM_STYLES')">
|
<div class="item" @click="exec('REMOVE_CUSTOM_STYLES')">
|
||||||
<span class="name">{{ $t('contextmenu.removeCustomStyles') }}</span>
|
<span class="name">{{ $t('contextmenu.removeCustomStyles') }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="item" @click="exec('EXPORT_CUR_NODE_TO_PNG')">
|
||||||
|
<span class="name">{{ $t('contextmenu.exportNodeToPng') }}</span>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="type === 'svg'">
|
<template v-if="type === 'svg'">
|
||||||
<div class="item" @click="exec('RETURN_CENTER')">
|
<div class="item" @click="exec('RETURN_CENTER')">
|
||||||
@ -139,6 +142,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapMutations } from 'vuex'
|
import { mapState, mapMutations } from 'vuex'
|
||||||
|
import { getTextFromHtml } from 'simple-mind-map/src/utils'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: 王林
|
* @Author: 王林
|
||||||
@ -342,6 +346,15 @@ export default {
|
|||||||
case 'REMOVE_NOTE':
|
case 'REMOVE_NOTE':
|
||||||
this.node.setNote('')
|
this.node.setNote('')
|
||||||
break
|
break
|
||||||
|
case 'EXPORT_CUR_NODE_TO_PNG':
|
||||||
|
this.mindMap.export(
|
||||||
|
'png',
|
||||||
|
true,
|
||||||
|
getTextFromHtml(this.node.getData('text')),
|
||||||
|
false,
|
||||||
|
this.node
|
||||||
|
)
|
||||||
|
break
|
||||||
default:
|
default:
|
||||||
this.$bus.$emit('execCommand', key, ...args)
|
this.$bus.$emit('execCommand', key, ...args)
|
||||||
break
|
break
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user