使用el-submenu中的slot来渲染菜单出现slot重复警告
What is Expected?
使用el-submenu中的slot来渲染菜单出现slot重复警告
代码
<el-menu class="el-menu-vertical-demo" unique-opened router :class="{'toggled': sidebarToggled}" :default-active="$route.path">
<template v-for="(menu, index) in menus">
<el-submenu :index="index + ''">
<template slot="title"><i class="el-submenu__icon fa fa-dashboard"></i><span class="el-submenu__name">{{menu.name}}</span></template>
<el-menu-item v-for="child in menu.children" :index="child.path"><span class="el-menu-item__name">{{child.name}}</span></el-menu-item>
</el-submenu>
</template>
</el-menu>
firebug控制台输出
[Vue warn]: Duplicate presence of slot "default" found in the same render tree - this will likely cause render errors.
(found in
[Vue warn]: Duplicate presence of slot "title" found in the same render tree - this will likely cause render errors.
(found in
给一下 demo
@Leopoldthecoder
github地址https://github.com/ElemeFE/element-dashboard
登录之后进入首页(此时不报错) 刷新浏览器后会报错
我也碰到了,很奇怪是在一个特定的页面,刷新后才会出现。
@susansjy 这个问题应该是使用了watch导致的 我的代码加入vuex之后去掉了watch自动解决了
如果说的不对,我觉得我们可以交流一下
Hello, this issue has been closed because it does not conform to our issue requirements. Please submit issues with issue-generator. More info can be found in #3693.