Skip to content

Commit e2fba07

Browse files
committed
trackby -> track-by
1 parent 3ae384c commit e2fba07

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/directives/repeat.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ module.exports = {
4242
this.checkRef()
4343
this.checkComponent()
4444
// check for trackby param
45-
this.idKey = this._checkParam('trackby')
45+
this.idKey =
46+
this._checkParam('track-by') ||
47+
this._checkParam('trackby') // 0.11.0 compat
4648
// cache for primitive value instances
4749
this.cache = Object.create(null)
4850
},

test/unit/specs/directives/repeat_spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,10 @@ if (_.inBrowser) {
287287
}
288288
})
289289

290-
it('trackby id', function (done) {
290+
it('track by id', function (done) {
291291

292-
assertTrackBy('<div v-repeat="list" trackby="id">{{msg}}</div>', function () {
293-
assertTrackBy('<div v-repeat="item:list" trackby="id">{{item.msg}}</div>', done)
292+
assertTrackBy('<div v-repeat="list" track-by="id">{{msg}}</div>', function () {
293+
assertTrackBy('<div v-repeat="item:list" track-by="id">{{item.msg}}</div>', done)
294294
})
295295

296296
function assertTrackBy (template, next) {

0 commit comments

Comments
 (0)