Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

el-menu导航动态绑定,会报错 #1670

Closed
no5no6 opened this issue Dec 10, 2016 · 3 comments
Closed

el-menu导航动态绑定,会报错 #1670

no5no6 opened this issue Dec 10, 2016 · 3 comments

Comments

@no5no6
Copy link

no5no6 commented Dec 10, 2016

hi,很高兴使用上你们提供的UI组件,真的很棒!但是我在使用el-menu的时候发现,如果用v-for循环遍历生成el-menu的时候绑定index,控制台会报错。是我使用的方法有问题么?代码如下:
https://jsfiddle.net/LittleChild/kajf2cx2/

@Leopoldthecoder
Copy link
Contributor

el-submenu 要求 index 参数为字符串类型,而 :index="index" 这样绑定的是数字类型。改成 :index="index + ''" 就可以。

@no5no6
Copy link
Author

no5no6 commented Dec 10, 2016

谢谢👍

@taishan802
Copy link

我遇到类似的问题:{{secItem.name}} 对这个二级导航条,componet都是string,一直报错vue.esm.js?65d7:576 [Vue warn]: Duplicate keys detected: 'index'. This may cause an update error.,求大神帮忙看看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants