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 vuejs#6817
  • Loading branch information
yyx990803 authored and lovelope committed Feb 1, 2018
1 parent b6c3697 commit 6b9a511
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 6b9a511

Please sign in to comment.