Skip to content

Commit

Permalink
feat: feat: add warning for ambiguous combined usage of slot-scope an…
Browse files Browse the repository at this point in the history
…d v-for

close #6817
  • Loading branch information
yyx990803 committed Nov 20, 2017
1 parent 4c22d1d commit c264335
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/compiler/parser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,15 @@ function processSlot (el) {
}
el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope')
} else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && el.attrsMap['v-for']) {
warn(
`Ambiguous combined usage of slot-scope and v-for on <${el.tag}> ` +
`(v-for takes higher priority). Use a wrapper <template> for the ` +
`scoped slot to make it clearer.`,
true
)
}
el.slotScope = slotScope
}
const slotTarget = getBindingAttr(el, 'slot')
Expand Down

0 comments on commit c264335

Please sign in to comment.