Skip to content

Commit ce4342b

Browse files
committed
revert repeated item $destroy behavior
1 parent d364b5c commit ce4342b

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

src/directives/repeat.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ module.exports = {
222222
}
223223
// in case `$destroy` is called directly on a repeated vm
224224
// make sure the vm's data is properly removed
225-
item.$compiler.observer.on('hook:afterDestroy', function () {
226-
col.remove(data)
227-
})
225+
// item.$compiler.observer.on('hook:afterDestroy', function () {
226+
// col.remove(data)
227+
// })
228228
}
229229
},
230230

test/functional/fixtures/repeated-items.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</p>
2121
<p>Total items: <span class="count" v-text="items.length"></span></p>
2222
<ul>
23-
<li class="item" v-repeat="items" v-on="click:this.$destroy()">
23+
<li class="item" v-repeat="items">
2424
{{$index}} {{title}}
2525
</li>
2626
</ul>

test/functional/specs/repeated-items.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* global items */
22

3-
casper.test.begin('Repeated Items', 44, function (test) {
3+
casper.test.begin('Repeated Items', 41, function (test) {
44

55
casper
66
.start('./fixtures/repeated-items.html')
@@ -83,13 +83,6 @@ casper.test.begin('Repeated Items', 44, function (test) {
8383
test.assertSelectorHasText('.item:nth-child(1)', '0 6')
8484
test.assertSelectorHasText('.item:nth-child(2)', '1 7')
8585
})
86-
.thenClick('.item:nth-child(1)', function () {
87-
test.assertSelectorHasText('.count', '1')
88-
test.assertSelectorHasText('.item:nth-child(1)', '0 7')
89-
test.assertEval(function () {
90-
return items.length === 1 && items[0].title === '7'
91-
})
92-
})
9386
.run(function () {
9487
test.done()
9588
})

0 commit comments

Comments
 (0)