File tree 4 files changed +21
-23
lines changed
test/unit/specs/directives/public/for
4 files changed +21
-23
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,7 @@ import {
16
16
def ,
17
17
cancellable ,
18
18
isArray ,
19
- isPlainObject ,
20
- findVmFromFrag
19
+ isPlainObject
21
20
} from '../../util/index'
22
21
23
22
let uid = 0
@@ -658,4 +657,22 @@ if (process.env.NODE_ENV !== 'production') {
658
657
}
659
658
}
660
659
660
+ /**
661
+ * Find a vm from a fragment.
662
+ *
663
+ * @param {Fragment } frag
664
+ * @return {Vue|undefined }
665
+ */
666
+
667
+ function findVmFromFrag ( frag ) {
668
+ let node = frag . node
669
+ // handle multi-node frag
670
+ if ( frag . end ) {
671
+ while ( ! node . __vue__ && node !== frag . end && node . nextSibling ) {
672
+ node = node . nextSibling
673
+ }
674
+ }
675
+ return node . __vue__
676
+ }
677
+
661
678
export default vFor
Original file line number Diff line number Diff line change 5
5
remove ,
6
6
replace ,
7
7
createAnchor ,
8
- warn ,
9
- findVmFromFrag
8
+ warn
10
9
} from '../../util/index'
11
10
12
11
export default {
Original file line number Diff line number Diff line change @@ -449,21 +449,3 @@ export function getOuterHTML (el) {
449
449
return container . innerHTML
450
450
}
451
451
}
452
-
453
- /**
454
- * Find a vm from a fragment.
455
- *
456
- * @param {Fragment } frag
457
- * @return {Vue|undefined }
458
- */
459
-
460
- export function findVmFromFrag ( frag ) {
461
- let node = frag . node
462
- // handle multi-node frag
463
- if ( frag . end ) {
464
- while ( ! node . __vue__ && node !== frag . end && node . nextSibling ) {
465
- node = node . nextSibling
466
- }
467
- }
468
- return node . __vue__
469
- }
Original file line number Diff line number Diff line change @@ -1002,7 +1002,7 @@ describe('v-for', function () {
1002
1002
expect ( 'Frozen v-for objects cannot be automatically tracked' ) . toHaveBeenWarned ( )
1003
1003
} )
1004
1004
1005
- it ( 'warn v-if and v-for mixed usage' , ( ) => {
1005
+ it ( 'warn v-if and v-for mixed usage' , function ( ) {
1006
1006
new Vue ( {
1007
1007
el : document . createElement ( 'div' ) ,
1008
1008
template : '<div v-for="item in items" v-if="ok"></div>' ,
You can’t perform that action at this time.
0 commit comments