Skip to content

Commit f8511d1

Browse files
committed
fix(core): static trees should be cached on options (vuejs#6826)
1 parent d22d596 commit f8511d1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/instance/render-helpers/render-static.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export function renderStatic (
1111
): VNode | Array<VNode> {
1212
// static trees can be rendered once and cached on the contructor options
1313
// so every instance shares the same cached trees
14-
const renderFns = this.$options.staticRenderFns
15-
const cached = renderFns.cached || (renderFns.cached = [])
14+
const options = this.$options
15+
const cached = options.cached || (options.cached = [])
1616
let tree = cached[index]
1717
// if has already-rendered static tree and not inside v-for,
1818
// we can reuse the same tree by doing a shallow clone.
@@ -22,7 +22,7 @@ export function renderStatic (
2222
: cloneVNode(tree)
2323
}
2424
// otherwise, render a fresh tree.
25-
tree = cached[index] = renderFns[index].call(this._renderProxy, null, this)
25+
tree = cached[index] = options.staticRenderFns[index].call(this._renderProxy, null, this)
2626
markStatic(tree, `__static__${index}`, false)
2727
return tree
2828
}

0 commit comments

Comments
 (0)