From b32c4b693535c35ae10742eb3351cbc123b15941 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 10 Jan 2019 12:32:06 -0500 Subject: [PATCH] fix: ensure proxied normal slot uses correct key --- src/core/vdom/helpers/normalize-scoped-slots.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/vdom/helpers/normalize-scoped-slots.js b/src/core/vdom/helpers/normalize-scoped-slots.js index 15aa7b13..aa38a299 100644 --- a/src/core/vdom/helpers/normalize-scoped-slots.js +++ b/src/core/vdom/helpers/normalize-scoped-slots.js @@ -19,7 +19,7 @@ export function normalizeScopedSlots ( } // expose normal slots on scopedSlots for (const key in normalSlots) { - res[key] = () => normalSlots[key] + res[key] = proxyNormalSlot(normalSlots, key) } res._normalized = true return res @@ -31,3 +31,7 @@ function normalizeScopedSlot(fn: Function) { return Array.isArray(res) ? res : res ? [res] : res } } + +function proxyNormalSlot(slots, key) { + return () => slots[key] +}