From 7a0dfd0badf3054c95ac1ec66cc6e213f1592c95 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 8 Feb 2019 14:35:37 -0500 Subject: [PATCH] perf: cache result from functional ctx.slots() calls --- src/core/vdom/create-functional-component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/vdom/create-functional-component.js b/src/core/vdom/create-functional-component.js index 533fb2363f..7acd8a9aef 100644 --- a/src/core/vdom/create-functional-component.js +++ b/src/core/vdom/create-functional-component.js @@ -49,7 +49,7 @@ export function FunctionalRenderContext ( this.parent = parent this.listeners = data.on || emptyObject this.injections = resolveInject(options.inject, parent) - this.slots = () => resolveSlots(children, parent) + this.slots = () => this.$slots || (this.$slots = resolveSlots(children, parent)) Object.defineProperty(this, 'scopedSlots', ({ enumerable: true,