Skip to content

Commit e5da1da

Browse files
committed
test(weex): avoid v-else warning for recycle-list tests
1 parent bb8e8f4 commit e5da1da

File tree

1 file changed

+5
-5
lines changed
  • src/platforms/weex/compiler/modules/recycle-list

1 file changed

+5
-5
lines changed

src/platforms/weex/compiler/modules/recycle-list/v-if.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ function getPrevMatch (el: ASTElement): any {
2121
export function preTransformVIf (el: ASTElement, options: CompilerOptions) {
2222
if (hasConditionDirective(el)) {
2323
let exp
24-
const ifExp = getAndRemoveAttr(el, 'v-if')
25-
const elseifExp = getAndRemoveAttr(el, 'v-else-if')
24+
const ifExp = getAndRemoveAttr(el, 'v-if', true /* remove from attrsMap */)
25+
const elseifExp = getAndRemoveAttr(el, 'v-else-if', true)
26+
// don't need the value, but remove it to avoid being generated as a
27+
// custom directive
28+
getAndRemoveAttr(el, 'v-else', true)
2629
if (ifExp) {
2730
exp = ifExp
2831
} else {
@@ -41,8 +44,5 @@ export function preTransformVIf (el: ASTElement, options: CompilerOptions) {
4144
}
4245
el.attrsMap['[[match]]'] = exp
4346
el.attrsList.push({ name: '[[match]]', value: exp })
44-
delete el.attrsMap['v-if']
45-
delete el.attrsMap['v-else-if']
46-
delete el.attrsMap['v-else']
4747
}
4848
}

0 commit comments

Comments
 (0)