Skip to content

Commit

Permalink
feat: 设置 icon: '' 可以取消默认的菜单图标
Browse files Browse the repository at this point in the history
  • Loading branch information
FairyEver committed Nov 16, 2018
1 parent 42f6ad6 commit 96b458d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<el-menu-item :index="menu.path || uniqueId">
<i v-if="menu.icon" :class="`fa fa-${menu.icon}`"></i>
<d2-icon-svg v-else-if="menu.iconSvg" :name="menu.iconSvg"/>
<i v-else class="fa fa-file-o"></i>
<i v-if="menu.icon === undefined" class="fa fa-file-o"></i>
<d2-icon-svg v-if="menu.iconSvg" :name="menu.iconSvg"/>
<span slot="title">{{menu.title || '未命名菜单'}}</span>
</el-menu-item>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<el-submenu :index="menu.path || uniqueId">
<template slot="title">
<i v-if="menu.icon" :class="`fa fa-${menu.icon}`"></i>
<d2-icon-svg v-else-if="menu.iconSvg" :name="menu.iconSvg"/>
<i v-else class="fa fa-folder-o"></i>
<i v-if="menu.icon === undefined" class="fa fa-folder-o"></i>
<d2-icon-svg v-if="menu.iconSvg" :name="menu.iconSvg"/>
<span slot="title">{{menu.title}}</span>
</template>
<template v-for="(child, childIndex) in menu.children">
Expand Down
22 changes: 11 additions & 11 deletions src/menu/modules/demo-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,32 @@ export default {
{
title: '填充型',
children: [
{ path: `${pre}container/full`, title: '基础' },
{ path: `${pre}container/full-slot`, title: '插槽' },
{ path: `${pre}container/full-bs`, title: '滚动优化' }
{ path: `${pre}container/full`, title: '基础', icon: '' },
{ path: `${pre}container/full-slot`, title: '插槽', icon: '' },
{ path: `${pre}container/full-bs`, title: '滚动优化', icon: '' }
]
},
{
title: '隐形模式',
children: [
{ path: `${pre}container/ghost`, title: '基础' },
{ path: `${pre}container/ghost-slot`, title: '插槽' },
{ path: `${pre}container/ghost-bs`, title: '滚动优化' }
{ path: `${pre}container/ghost`, title: '基础', icon: '' },
{ path: `${pre}container/ghost-slot`, title: '插槽', icon: '' },
{ path: `${pre}container/ghost-bs`, title: '滚动优化', icon: '' }
]
},
{
title: '卡片型',
children: [
{ path: `${pre}container/card`, title: '基础' },
{ path: `${pre}container/card-slot`, title: '插槽' },
{ path: `${pre}container/card-bs`, title: '滚动优化' }
{ path: `${pre}container/card`, title: '基础', icon: '' },
{ path: `${pre}container/card-slot`, title: '插槽', icon: '' },
{ path: `${pre}container/card-bs`, title: '滚动优化', icon: '' }
]
},
{
title: '方法',
children: [
{ path: `${pre}container/api?bs=false`, title: '滚动控制' },
{ path: `${pre}container/api?bs=true`, title: '滚动控制 BS' }
{ path: `${pre}container/api?bs=false`, title: '滚动控制', icon: '' },
{ path: `${pre}container/api?bs=true`, title: '滚动控制 BS', icon: '' }
]
}
]
Expand Down

0 comments on commit 96b458d

Please sign in to comment.