File tree 2 files changed +39
-1
lines changed
2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export var Computed = (function(_super) {
75
75
for ( var i in this . deps ) {
76
76
if ( this . deps [ i ] . version !== this . depsVersion [ i ] ) {
77
77
toComputed = true
78
- this . deps [ i ] . version = this . depsVersion [ i ]
78
+ this . depsVersion [ i ] = this . deps [ i ] . version
79
79
}
80
80
}
81
81
return toComputed
Original file line number Diff line number Diff line change @@ -291,6 +291,44 @@ describe('Computed', function () {
291
291
expect ( vm . c ) . toBe ( 25 )
292
292
delete avalon . vmodels . computed01
293
293
} )
294
+
295
+ it ( 'test2' , function ( done ) {
296
+ var body = document . body
297
+ var div = document . createElement ( 'div' )
298
+ div . innerHTML = heredoc ( function ( ) {
299
+ /*
300
+ <div :controller="computed02">
301
+ <div>{{@b }}</div>
302
+ <div>{{@c }}</div>
303
+ </div>
304
+ */
305
+ } )
306
+ body . appendChild ( div )
307
+
308
+ var vm = avalon . define ( {
309
+ $id : 'computed02' ,
310
+ $computed : {
311
+ b : function ( ) {
312
+ return this . a + 1
313
+ } ,
314
+ c : function ( ) {
315
+ return this . a + 2
316
+ }
317
+ } ,
318
+ a : 1
319
+ } )
320
+ avalon . scan ( div )
321
+
322
+ setTimeout ( function ( ) {
323
+ vm . a = 10
324
+ expect ( vm . b ) . toBe ( 11 )
325
+ expect ( vm . c ) . toBe ( 12 )
326
+
327
+ body . removeChild ( div )
328
+ delete avalon . vmodels . computed02
329
+ done ( )
330
+ } , 500 ) ;
331
+ } )
294
332
} )
295
333
296
334
describe ( 'Action' , function ( ) {
You can’t perform that action at this time.
0 commit comments