From 902afbe47afef76c981065ed94c1eda2d3895620 Mon Sep 17 00:00:00 2001 From: iczer <1126263215@qq.com> Date: Thu, 27 Aug 2020 19:55:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20problem=20that=20title=20of=20menu=20ite?= =?UTF-8?q?m=20can't=20be=20hidden=20when=20using=20slot=20icon=20in=20sid?= =?UTF-8?q?e=20menu;=20:bug:=20=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=9C=A8?= =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E8=8F=9C=E5=8D=95=E4=B8=AD=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=8F=92=E6=A7=BD=E5=9B=BE=E6=A0=87=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E9=A1=B9=E6=A0=87=E9=A2=98=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/menu/menu.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/menu/menu.js b/src/components/menu/menu.js index 0008e7c..15d18eb 100644 --- a/src/components/menu/menu.js +++ b/src/components/menu/menu.js @@ -121,7 +121,12 @@ export default { 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}}) },