File tree 7 files changed +70
-1
lines changed
7 files changed +70
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export default class Component extends Node {
37
37
attribute . expression . arguments . forEach ( ( arg : Node ) => {
38
38
block . addDependencies ( arg . metadata . dependencies ) ;
39
39
} ) ;
40
- } else if ( attribute . type === 'Binding' ) {
40
+ } else if ( attribute . type === 'Binding' || attribute . type === 'Spread' ) {
41
41
block . addDependencies ( attribute . metadata . dependencies ) ;
42
42
}
43
43
}
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ export default class Element extends Node {
89
89
}
90
90
} else if ( attribute . type === 'Action' && attribute . expression ) {
91
91
block . addDependencies ( attribute . metadata . dependencies ) ;
92
+ } else if ( attribute . type === 'Spread' ) {
93
+ block . addDependencies ( attribute . metadata . dependencies ) ;
92
94
}
93
95
}
94
96
} ) ;
Original file line number Diff line number Diff line change
1
+ < div data-a ={a} data-b ={b} > </ div >
Original file line number Diff line number Diff line change
1
+ export default {
2
+ html : `
3
+ <div data-a="1" data-b="2"></div>
4
+ <div data-a="3" data-b="4"></div>
5
+ ` ,
6
+
7
+ data : {
8
+ things : [
9
+ { a : 1 , b : 2 } ,
10
+ { a : 3 , b : 4 }
11
+ ]
12
+ } ,
13
+
14
+ test ( assert , component , target ) {
15
+ const { things } = component . get ( ) ;
16
+
17
+ component . set ( {
18
+ things : things . reverse ( )
19
+ } ) ;
20
+
21
+ assert . htmlEqual ( target . innerHTML , `
22
+ <div data-a="3" data-b="4"></div>
23
+ <div data-a="1" data-b="2"></div>
24
+ ` ) ;
25
+ } ,
26
+ } ;
Original file line number Diff line number Diff line change
1
+ {#each things as thing}
2
+ < Nested {...thing} />
3
+ {/each}
4
+
5
+ < script >
6
+ import Nested from './Nested.html' ;
7
+
8
+ export default {
9
+ components : { Nested }
10
+ } ;
11
+ </ script >
Original file line number Diff line number Diff line change
1
+ export default {
2
+ html : `
3
+ <div data-a="1" data-b="2"></div>
4
+ <div data-c="3" data-d="4"></div>
5
+ ` ,
6
+
7
+ data : {
8
+ things : [
9
+ { 'data-a' : 1 , 'data-b' : 2 } ,
10
+ { 'data-c' : 3 , 'data-d' : 4 }
11
+ ]
12
+ } ,
13
+
14
+ test ( assert , component , target ) {
15
+ const { things } = component . get ( ) ;
16
+
17
+ component . set ( {
18
+ things : things . reverse ( )
19
+ } ) ;
20
+
21
+ assert . htmlEqual ( target . innerHTML , `
22
+ <div data-c="3" data-d="4"></div>
23
+ <div data-a="1" data-b="2"></div>
24
+ ` ) ;
25
+ } ,
26
+ } ;
Original file line number Diff line number Diff line change
1
+ {#each things as thing}
2
+ < div {...thing} > </ div >
3
+ {/each}
You can’t perform that action at this time.
0 commit comments