研发图纸文件管理系统-前端项目
iczer
2020-08-27 902afbe47afef76c981065ed94c1eda2d3895620
fix: problem that title of menu item can't be hidden when using slot icon in side menu; :bug:
修复:在侧边栏菜单中使用插槽图标时,菜单项标题不能隐藏的问题;
1个文件已修改
7 ■■■■ 已修改文件
src/components/menu/menu.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/menu/menu.js
@@ -121,7 +121,12 @@
  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}})
    },