Kaynağa Gözat

fix: init _staticTrees to avoid runtime reference warning

fix #7075
Evan You 8 yıl önce
ebeveyn
işleme
f5cd29e1d8
2 değiştirilmiş dosya ile 2 ekleme ve 0 silme
  1. 1 0
      flow/component.js
  2. 1 0
      src/core/instance/render.js

+ 1 - 0
flow/component.js

@@ -66,6 +66,7 @@ declare interface Component {
   _isDestroyed: boolean;
   _isBeingDestroyed: boolean;
   _vnode: ?VNode; // self root node
+  _staticTrees: ?Array<VNode>; // v-once cached trees
   _hasHookEvent: boolean;
   _provided: ?Object;
 

+ 1 - 0
src/core/instance/render.js

@@ -17,6 +17,7 @@ import { isUpdatingChildComponent } from './lifecycle'
 
 export function initRender (vm: Component) {
   vm._vnode = null // the root of the child tree
+  vm._staticTrees = null // v-once cached trees
   const options = vm.$options
   const parentVnode = vm.$vnode = options._parentVnode // the placeholder node in parent tree
   const renderContext = parentVnode && parentVnode.context