Forráskód Böngészése

refactor: move isRuntimeCompiled flag into component.ts

Evan You 6 éve
szülő
commit
2b178981bc
2 módosított fájl, 2 hozzáadás és 1 törlés
  1. 2 0
      packages/runtime-core/src/component.ts
  2. 0 1
      packages/vue/src/index.ts

+ 2 - 0
packages/runtime-core/src/component.ts

@@ -371,6 +371,8 @@ function finishComponentSetup(
       Component.render = compile!(Component.template, {
         isCustomElement: instance.appContext.config.isCustomElement || NO
       })
+      // mark the function as runtime compiled
+      ;(Component.render as RenderFunction).isRuntimeCompiled = true
     }
 
     if (__DEV__ && !Component.render) {

+ 0 - 1
packages/vue/src/index.ts

@@ -54,7 +54,6 @@ function compileToFunction(
   })
 
   const render = new Function('Vue', code)(runtimeDom) as RenderFunction
-  render.isRuntimeCompiled = true
   return (compileCache[key] = render)
 }