Prechádzať zdrojové kódy

refactor: isCE -> ce

Evan You 1 rok pred
rodič
commit
b74687c0bb

+ 1 - 1
packages/runtime-core/src/component.ts

@@ -417,7 +417,7 @@ export interface ComponentInternalInstance {
    * is custom element?
    * @internal
    */
-  isCE?: Element
+  ce?: Element
   /**
    * custom element specific HMR method
    * @internal

+ 2 - 2
packages/runtime-core/src/helpers/renderSlot.ts

@@ -32,10 +32,10 @@ export function renderSlot(
   noSlotted?: boolean,
 ): VNode {
   if (
-    currentRenderingInstance!.isCE ||
+    currentRenderingInstance!.ce ||
     (currentRenderingInstance!.parent &&
       isAsyncWrapper(currentRenderingInstance!.parent) &&
-      currentRenderingInstance!.parent.isCE)
+      currentRenderingInstance!.parent.ce)
   ) {
     // in custom element mode, render <slot/> as actual slot outlets
     // wrap it with a fragment because in shadowRoot: false mode the slot

+ 3 - 3
packages/runtime-dom/src/apiCustomElement.ts

@@ -259,7 +259,7 @@ export class VueElement extends BaseClass {
           this._ob = null
         }
         render(null, this._root)
-        this._instance!.isCE = undefined
+        this._instance!.ce = undefined
         this._instance = null
       }
     })
@@ -433,7 +433,7 @@ export class VueElement extends BaseClass {
     if (!this._instance) {
       vnode.ce = instance => {
         this._instance = instance
-        instance.isCE = this
+        instance.ce = this
         // HMR
         if (__DEV__) {
           instance.ceReload = newStyles => {
@@ -555,7 +555,7 @@ export class VueElement extends BaseClass {
  */
 export function useShadowRoot(): ShadowRoot | null {
   const instance = getCurrentInstance()
-  const el = instance && instance.isCE
+  const el = instance && instance.ce
   if (el) {
     return el.shadowRoot
   } else if (__DEV__) {