From baa0ae27b29d5c76580753af13160254e4ece5d7 Mon Sep 17 00:00:00 2001 From: 李红刚 <p-honggang.li@pcitc.com> Date: 星期五, 12 三月 2021 16:28:11 +0800 Subject: [PATCH] 修改坐上叫菜单导航BUG问题 --- src/components/panel/BaseNavMenuItem.vue | 12 ++-- src/components/panel/ToolBoxPanel.vue | 154 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 98 insertions(+), 68 deletions(-) diff --git a/src/components/panel/BaseNavMenuItem.vue b/src/components/panel/BaseNavMenuItem.vue index 67980cc..69330e9 100644 --- a/src/components/panel/BaseNavMenuItem.vue +++ b/src/components/panel/BaseNavMenuItem.vue @@ -2,17 +2,17 @@ <div class="base-nav-menu"> <template v-for="(item,index) in menuList"> <template v-if="item.items && item.items.length"> - <el-submenu :index="index+''" :key="index"> - <template slot="title" v-if="item.title"> - <img :src="item.title" :title="item.alt"/> + <el-submenu :index="item.index" :key="index"> + <template slot="title" v-if="item.icon"> + <img :src="item.icon" :title="item.label"/> </template> - <template slot="title" v-else>{{item.headings}}</template> + <template slot="title" v-else>{{item.label}}</template> <base-nav-menu-item v-for="child in item.items" :key="child.title" :menuList='[child]'></base-nav-menu-item> </el-submenu> </template> <template v-else> - <el-menu-item :index="index+''" :key="index"> - {{ item.headings }} + <el-menu-item :index="item.index" :key="index"> + {{ item.label }} </el-menu-item> </template> </template> diff --git a/src/components/panel/ToolBoxPanel.vue b/src/components/panel/ToolBoxPanel.vue index 74a25e2..1b9fd88 100644 --- a/src/components/panel/ToolBoxPanel.vue +++ b/src/components/panel/ToolBoxPanel.vue @@ -46,85 +46,115 @@ return { menuList: [ { - title: circle, - alt: '鏍囩粯', + icon: circle, + label: '鏍囩粯', + index: '1', items: [ { - headings: '鐐规爣缁�' + index: '1-1', + label: '鐐规爣缁�' }, { - headings: '绾挎爣缁�' + index: '1-2', + label: '绾挎爣缁�' }, { - headings: '闈㈡爣缁�', + index: '1-3', + label: '闈㈡爣缁�', items: [ - { headings: '鍦嗗舰' }, - { headings: '澶氳竟褰�' }, - { headings: '鐭╁舰' } - ] - } - ] - }, - // { - // title: square, - // alt: '鏍囨敞', - // items: [ - // { headings: '鐐规爣娉�' }, - // { headings: '绾挎爣娉�' }, - // { headings: '闈㈡爣娉�' }, - // { headings: '鏂囧瓧鏍囨敞' }, - // { headings: '鍥炬爣鏍囨敞' } - // ] - // }, - // { - // title: legend, - // alt: '娴嬮噺', - // items: [ - // { headings: '璺濈娴嬮噺' }, - // { headings: '闈㈢Н娴嬮噺' } - // ] - // }, - { - title: location, - alt: '鍒囨崲搴曞浘', - items: [ - { - headings: '褰卞儚鍥�', - items: [ - { headings: '褰卞儚妯欐敞' } - ] - }, - { - headings: '鐭㈤噺鍥�', - items: [ - { headings: '鐭㈤噺妯欐敞' } - ] - }, - { - headings: '鍦板舰鍥�', - items: [ - { headings: '鍦板舰妯欐敞' } + { + index: '1-3-1', + label: '鍦嗗舰' + }, + { + index: '1-3-2', + label: '澶氳竟褰�' + }, + { + index: '1-3-3', + label: '鐭╁舰' + } ] } ] }, { - title: polygon, - alt: '绠$綉', + icon: location, + label: '鍒囨崲搴曞浘', + index: '2', items: [ - { headings: '杩為�氭�у垎鏋�' }, - { headings: '鐖嗙鍒嗘瀽' }, - { headings: '娴佸悜鍒嗘瀽' }, - { headings: '妯柇闈㈠垎鏋�' } + { + label: '褰卞儚鍥�', + index: '2-1', + items: [ + { + index: '2-1-1', + label: '褰卞儚妯欐敞' + } + ] + }, + { + label: '鐭㈤噺鍥�', + index: '2-2', + items: [ + { + index: '2-2-1', + label: '鐭㈤噺妯欐敞' + } + ] + }, + { + label: '鍦板舰鍥�', + index: '2-3', + items: [ + { + index: '2-3-1', + label: '鍦板舰妯欐敞' + } + ] + } ] }, { - title: fullscreen, - alt: '涓嬭浇', + icon: polygon, + label: '绠$綉', + index: '3', items: [ - { headings: '鍏ㄥ睆' }, - { headings: 'A4妯悜' }, - { headings: 'A4绾靛悜' } + { + index: '3-1', + label: '杩為�氭�у垎鏋�' + }, + { + index: '3-2', + label: '鐖嗙鍒嗘瀽' + }, + { + index: '3-3', + label: '娴佸悜鍒嗘瀽' + }, + { + index: '3-4', + label: '妯柇闈㈠垎鏋�' + } + ] + }, + { + icon: fullscreen, + label: '涓嬭浇', + index: '4', + items: [ + { + index: '4-1', + label: '鍏ㄥ睆' + }, + { + index: '4-2', + label: 'A4妯悜' + }, + { + index: '4-3', + label: 'A4绾靛悜' + } ] } ], -- Gitblit v1.8.0