Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromvuejs/vue

Commit2268c51

Browse files
committed
fix tests
1 parentaacf90a commit2268c51

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

‎src/directives/public/for.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import {
1616
def,
1717
cancellable,
1818
isArray,
19-
isPlainObject,
20-
findVmFromFrag
19+
isPlainObject
2120
}from'../../util/index'
2221

2322
letuid=0
@@ -658,4 +657,22 @@ if (process.env.NODE_ENV !== 'production') {
658657
}
659658
}
660659

660+
/**
661+
* Find a vm from a fragment.
662+
*
663+
*@param {Fragment} frag
664+
*@return {Vue|undefined}
665+
*/
666+
667+
functionfindVmFromFrag(frag){
668+
letnode=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+
returnnode.__vue__
676+
}
677+
661678
exportdefaultvFor

‎src/directives/public/if.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import {
55
remove,
66
replace,
77
createAnchor,
8-
warn,
9-
findVmFromFrag
8+
warn
109
}from'../../util/index'
1110

1211
exportdefault{

‎src/util/dom.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -449,21 +449,3 @@ export function getOuterHTML (el) {
449449
returncontainer.innerHTML
450450
}
451451
}
452-
453-
/**
454-
* Find a vm from a fragment.
455-
*
456-
*@param {Fragment} frag
457-
*@return {Vue|undefined}
458-
*/
459-
460-
exportfunctionfindVmFromFrag(frag){
461-
letnode=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-
returnnode.__vue__
469-
}

‎test/unit/specs/directives/public/for/for_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ describe('v-for', function () {
10021002
expect('Frozen v-for objects cannot be automatically tracked').toHaveBeenWarned()
10031003
})
10041004

1005-
it('warn v-if and v-for mixed usage',()=>{
1005+
it('warn v-if and v-for mixed usage',function(){
10061006
newVue({
10071007
el:document.createElement('div'),
10081008
template:'<div v-for="item in items" v-if="ok"></div>',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp