Demo:新增一键展开某个节点所有下级节点的右键菜单

This commit is contained in:
街角小林 2024-09-19 19:52:34 +08:00
parent 9f9ed1e84f
commit 29ddbba9b9
4 changed files with 12 additions and 3 deletions

View File

@ -111,7 +111,8 @@ export default {
copyToPng: 'Png',
copySuccess: 'Copy success',
copyFail: 'Copy fail',
number: 'Number child nodes'
number: 'Number child nodes',
expandNodeChild: 'Expand all sub nodes'
},
count: {
words: 'Words',

View File

@ -111,7 +111,8 @@ export default {
copyToPng: '图片',
copySuccess: '复制成功',
copyFail: '复制失败',
number: '编号其子节点'
number: '编号其子节点',
expandNodeChild: '展开所有下级节点'
},
count: {
words: '字数',

View File

@ -111,7 +111,8 @@ export default {
copyToPng: '圖片',
copySuccess: '複製成功',
copyFail: '複製失敗',
number: '將其子節點編號'
number: '將其子節點編號',
expandNodeChild: '展開所有下級節點'
},
count: {
words: '字數',

View File

@ -56,6 +56,9 @@
<span class="name">{{ $t('contextmenu.moveDownNode') }}</span>
<span class="desc">Ctrl + </span>
</div>
<div class="item" @click="exec('EXPAND_ALL')">
<span class="name">{{ $t('contextmenu.expandNodeChild') }}</span>
</div>
<div class="item" v-if="supportNumbers">
<span class="name">{{ $t('contextmenu.number') }}</span>
<span class="el-icon-arrow-right"></span>
@ -461,6 +464,9 @@ export default {
this.node
)
break
case 'EXPAND_ALL':
this.$bus.$emit('execCommand', key, this.node.uid)
break
default:
this.$bus.$emit('execCommand', key, ...args)
break