fix: problem that title of menu item can't be hidden when using slot icon in side menu; :bug:
修复:在侧边栏菜单中使用插槽图标时,菜单项标题不能隐藏的问题;
| | |
| | | methods: { |
| | | renderIcon: function (h, icon, key) { |
| | | if (this.$scopedSlots.icon && icon && icon !== 'none') { |
| | | return this.$scopedSlots.icon({icon, key}) |
| | | const vnodes = this.$scopedSlots.icon({icon, key}) |
| | | vnodes.forEach(vnode => { |
| | | vnode.data.class = vnode.data.class ? vnode.data.class : [] |
| | | vnode.data.class.push('anticon') |
| | | }) |
| | | return vnodes |
| | | } |
| | | return !icon || icon == 'none' ? null : h(Icon, {props: {type: icon}}) |
| | | }, |