Skip to content

Commit 671b911

Browse files
yyx990803hefeng
authored and
hefeng
committed
fix: properly mark slot rendered flag in production mode
fix vuejs#6997
1 parent 8ff0cdb commit 671b911

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/core/instance/render-helpers/render-slot.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ export function renderSlot (
2727
} else {
2828
const slotNodes = this.$slots[name]
2929
// warn duplicate slot usage
30-
if (slotNodes && process.env.NODE_ENV !== 'production') {
31-
slotNodes._rendered && warn(
32-
`Duplicate presence of slot "${name}" found in the same render tree ` +
33-
`- this will likely cause render errors.`,
34-
this
35-
)
30+
if (slotNodes) {
31+
if (process.env.NODE_ENV !== 'production' && slotNodes._rendered) {
32+
warn(
33+
`Duplicate presence of slot "${name}" found in the same render tree ` +
34+
`- this will likely cause render errors.`,
35+
this
36+
)
37+
}
3638
slotNodes._rendered = true
3739
}
3840
return slotNodes || fallback

0 commit comments

Comments
 (0)