Skip to content

Commit

Permalink
perf: cache result from functional ctx.slots() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Feb 8, 2019
1 parent 0e8560d commit 7a0dfd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/vdom/create-functional-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7a0dfd0

Please sign in to comment.