From 511db34757c0e1c118423eef477164fb56217186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=88=90=E6=B8=9D?= Date: Thu, 17 Oct 2024 10:01:49 +0800 Subject: [PATCH] fix(slots): ignore slots that contains only whitespace (#10839) --- src/core/instance/render-helpers/resolve-slots.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/instance/render-helpers/resolve-slots.ts b/src/core/instance/render-helpers/resolve-slots.ts index 5536f919145..6dc59cde63a 100644 --- a/src/core/instance/render-helpers/resolve-slots.ts +++ b/src/core/instance/render-helpers/resolve-slots.ts @@ -39,6 +39,7 @@ export function resolveSlots( } // ignore slots that contains only whitespace for (const name in slots) { + if (!slots.hasOwnProperty(name)) continue; if (slots[name].every(isWhitespace)) { delete slots[name] }