File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
test/unit/specs/directives/public/for Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,28 @@ describe('v-for', function () {
107
107
expect ( el . innerHTML ) . toBe ( '<div>aaa a</div><div>bbb b</div>' )
108
108
} )
109
109
110
+ it ( 'check priorities: v-if before v-for' , function ( ) {
111
+ new Vue ( {
112
+ el : el ,
113
+ data : {
114
+ items : [ 1 , 2 , 3 ]
115
+ } ,
116
+ template : '<div v-if="item < 3" v-for="item in items">{{item}}</div>'
117
+ } )
118
+ expect ( el . textContent ) . toBe ( '12' )
119
+ } )
120
+
121
+ it ( 'check priorities: v-if after v-for' , function ( ) {
122
+ new Vue ( {
123
+ el : el ,
124
+ data : {
125
+ items : [ 1 , 2 , 3 ]
126
+ } ,
127
+ template : '<div v-for="item in items" v-if="item < 3">{{item}}</div>'
128
+ } )
129
+ expect ( el . textContent ) . toBe ( '12' )
130
+ } )
131
+
110
132
it ( 'component' , function ( done ) {
111
133
var vm = new Vue ( {
112
134
el : el ,
You can’t perform that action at this time.
0 commit comments