Skip to content

Commit

Permalink
fix: properly mark slot rendered flag in production mode
Browse files Browse the repository at this point in the history
fix #6997
  • Loading branch information
yyx990803 committed Nov 3, 2017
1 parent e1657fd commit 4fe1a95
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/core/instance/render-helpers/render-slot.js
Expand Up @@ -27,12 +27,14 @@ export function renderSlot (
} else {
const slotNodes = this.$slots[name]
// warn duplicate slot usage
if (slotNodes && process.env.NODE_ENV !== 'production') {
slotNodes._rendered && warn(
`Duplicate presence of slot "${name}" found in the same render tree ` +
`- this will likely cause render errors.`,
this
)
if (slotNodes) {
if (process.env.NODE_ENV !== 'production' && slotNodes._rendered) {
warn(
`Duplicate presence of slot "${name}" found in the same render tree ` +
`- this will likely cause render errors.`,
this
)
}
slotNodes._rendered = true
}
return slotNodes || fallback
Expand Down

0 comments on commit 4fe1a95

Please sign in to comment.