mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 12:01:57 +08:00
Add sub-menu to context menu (#762)
This commit is contained in:
parent
4d6496f5c6
commit
0e698293c8
@ -60,7 +60,52 @@
|
|||||||
<div style="margin-right: 5%;margin-top: 10%;">
|
<div style="margin-right: 5%;margin-top: 10%;">
|
||||||
<i :class="iconAction(action)" style="font-weight: bolder;" />
|
<i :class="iconAction(action)" style="font-weight: bolder;" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<el-dropdown
|
||||||
|
v-if="!isEmptyValue(action.childs)"
|
||||||
|
>
|
||||||
|
<span class="contents">
|
||||||
|
<b class="label">
|
||||||
|
{{ action.name }}
|
||||||
|
</b>
|
||||||
|
</span>
|
||||||
|
<p
|
||||||
|
class="description"
|
||||||
|
>
|
||||||
|
{{ $t('data.noDescription') }}
|
||||||
|
</p>
|
||||||
|
<el-dropdown-menu
|
||||||
|
slot="dropdown"
|
||||||
|
@command="handleCommand"
|
||||||
|
>
|
||||||
|
<el-dropdown-item
|
||||||
|
v-for="(childs, key) in action.childs"
|
||||||
|
:key="key"
|
||||||
|
:command="childs"
|
||||||
|
:divided="true"
|
||||||
|
>
|
||||||
|
<span class="contents">
|
||||||
|
<b class="label" @click="handleCommand(childs)">
|
||||||
|
{{ childs.name }}
|
||||||
|
</b>
|
||||||
|
</span>
|
||||||
|
<p
|
||||||
|
v-if="!isEmptyValue(childs.description)"
|
||||||
|
class="description"
|
||||||
|
>
|
||||||
|
{{ childs.description }}
|
||||||
|
</p>
|
||||||
|
<p
|
||||||
|
v-else
|
||||||
|
class="description"
|
||||||
|
>
|
||||||
|
{{ $t('data.noDescription') }}
|
||||||
|
</p>
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
<div
|
||||||
|
v-else
|
||||||
|
>
|
||||||
<span class="contents">
|
<span class="contents">
|
||||||
<b class="label">
|
<b class="label">
|
||||||
{{ action.name }}
|
{{ action.name }}
|
||||||
@ -224,6 +269,9 @@ export default {
|
|||||||
this.runAction(action)
|
this.runAction(action)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handleCommand(childs) {
|
||||||
|
this.runAction(childs)
|
||||||
|
},
|
||||||
clickReferences(reference) {
|
clickReferences(reference) {
|
||||||
this.openReference(reference)
|
this.openReference(reference)
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user