Skip to content

Commit 4fe1a95

Browse files
committed
fix: properly mark slot rendered flag in production mode
fix #6997
1 parent e1657fd commit 4fe1a95

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)