[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify uniq
生活随笔
收集整理的這篇文章主要介紹了
[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify uniq
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
angularjs 使用ng-repeat報錯
?
<div ng-init="words = ['高校','高校','高校']" ng-repeat="word in words">{{word}} </div>[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys
? 發現是因為相同的內容重復引起,解決方案
?
<div ng-init="words = ['高校','高校','高校']" ng-repeat="word in words track by $index">{{word}} </div>在ng-repeat后面加上
?
track by $index?
轉載于:https://www.cnblogs.com/laneyfu/p/4747491.html
總結
以上是生活随笔為你收集整理的[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify uniq的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 深信服技术认证之Openstack云平台
- 下一篇: 总结下用Vue.js和webpack遇到