File tree Expand file tree Collapse file tree 4 files changed +53
-4
lines changed Expand file tree Collapse file tree 4 files changed +53
-4
lines changed Original file line number Diff line number Diff line change @@ -530,9 +530,7 @@ CompilerProto.markComputed = function (binding) {
530530 vm = this . vm
531531 binding . isComputed = true
532532 // bind the accessors to the vm
533- if ( binding . isFn ) {
534- binding . value = utils . bind ( value , vm )
535- } else {
533+ if ( ! binding . isFn ) {
536534 value . $get = utils . bind ( value . $get , vm )
537535 if ( value . $set ) {
538536 value . $set = utils . bind ( value . $set , vm )
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ module.exports = {
2929
3030 var compiler = this . compiler ,
3131 event = this . arg ,
32+ isExp = this . binding . isExp ,
3233 ownerVM = this . binding . compiler . vm
3334
3435 if ( compiler . repeat &&
@@ -51,7 +52,7 @@ module.exports = {
5152 if ( target ) {
5253 e . el = target
5354 e . targetVM = target . vue_viewmodel
54- handler . call ( ownerVM , e )
55+ handler . call ( isExp ? e . targetVM : ownerVM , e )
5556 }
5657 }
5758 dHandler . event = event
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < title > Repeated Expressions</ title >
5+ < meta charset ="utf-8 ">
6+ < script src ="../../../dist/vue.js "> </ script >
7+ </ head >
8+ < body >
9+ < ul id ="test ">
10+ < li
11+ v-repeat ="items "
12+ v-on ="click:n++ "
13+ class ="item-{{$index}} "
14+ >
15+ {{n}}
16+ </ li >
17+ </ ul >
18+ < script >
19+ var app = new Vue ( {
20+ el : '#test' ,
21+ data : {
22+ items : [
23+ { n : 1 } ,
24+ { n : 2 } ,
25+ { n : 3 }
26+ ]
27+ }
28+ } )
29+ </ script >
30+ </ body >
31+ </ html >
Original file line number Diff line number Diff line change 1+ casper . test . begin ( 'Repeated Expressions' , 3 , function ( test ) {
2+
3+ casper
4+ . start ( './fixtures/repeated-exp.html' )
5+ . then ( function ( ) {
6+ this . click ( '.item-0' )
7+ this . click ( '.item-1' )
8+ this . click ( '.item-2' )
9+ } )
10+ . then ( function ( ) {
11+ test . assertSelectorHasText ( '.item-0' , '2' )
12+ test . assertSelectorHasText ( '.item-1' , '3' )
13+ test . assertSelectorHasText ( '.item-2' , '4' )
14+ } )
15+ . run ( function ( ) {
16+ test . done ( )
17+ } )
18+
19+ } )
You can’t perform that action at this time.
0 commit comments