Skip to content

Commit

Permalink
test(weex): avoid v-else warning for recycle-list tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Nov 27, 2017
1 parent e429482 commit 7416ae4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/platforms/weex/compiler/modules/recycle-list/v-if.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ function getPrevMatch (el: ASTElement): any {
export function preTransformVIf (el: ASTElement, options: CompilerOptions) {
if (hasConditionDirective(el)) {
let exp
const ifExp = getAndRemoveAttr(el, 'v-if')
const elseifExp = getAndRemoveAttr(el, 'v-else-if')
const ifExp = getAndRemoveAttr(el, 'v-if', true /* remove from attrsMap */)
const elseifExp = getAndRemoveAttr(el, 'v-else-if', true)
// don't need the value, but remove it to avoid being generated as a
// custom directive
getAndRemoveAttr(el, 'v-else', true)
if (ifExp) {
exp = ifExp
} else {
Expand All @@ -41,8 +44,5 @@ export function preTransformVIf (el: ASTElement, options: CompilerOptions) {
}
el.attrsMap['[[match]]'] = exp
el.attrsList.push({ name: '[[match]]', value: exp })
delete el.attrsMap['v-if']
delete el.attrsMap['v-else-if']
delete el.attrsMap['v-else']
}
}

0 comments on commit 7416ae4

Please sign in to comment.