1.0.0-rc.5
Win7/Chrome 52
2.0.1
NavMenu组件在vertical模式下不能设置router为true,否则组件就消失了。
遇到了和你一样的问题,请问解决了吗?
[Vue warn]: Invalid prop: type check failed for prop "router". Expected Boolean, got String. (found in component <ElMenu>)
<el-menu mode="vertical" theme="dark" router=true default-active="/" class="el-menu-vertical-demo" >
<el-menu-item index="/"><i class="el-icon-message"></i>仪表盘</el-menu-item>
[Vue warn]: Invalid prop: type check failed for prop "router". Expected Boolean, got String. (found in component )
@anshengme 你的使用方法不对,应该在el-menu-item标签里写
<el-menu :router="true"></el-menu>
才能给vue组件传递布尔值,否则就识别成字符串了。
我也遇到了这个问题,这个解决方法看起来,怎么和api那么不一致呢。。。
api说明
看api,像theme都是 theme=“dark”,为什么router要用:router=“true”这种呢
确实好多坑, 文档什么都没说。 包括还有 Menu-Item Attribute 的route Vue Router 路径对象,怎么用一个字都没,这是让大家猜呢。
el-menu-item中route属性的添加。需要el-menu组件中的router的属性为true,才会有效@akeen
文档写的是个球,还误导人
For the English speaking users
If you use router make sure that its the first attribute
Wrong:
<el-menu :default-active="activeIndex" class="el-menu-demo" router="true" mode="horizontal">
Correct:
<el-menu :router="true" default-active="activeIndex" class="el-menu-demo" mode="horizontal">
Most helpful comment
@anshengme 你的使用方法不对,应该在el-menu-item标签里写
才能给vue组件传递布尔值,否则就识别成字符串了。