Browse Source

fix(custom-element): keep instance.isCE for backwards compat

Evan You 1 year ago
parent
commit
e19fc27042

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

@@ -414,10 +414,15 @@ export interface ComponentInternalInstance {
    */
   inheritAttrs?: boolean
   /**
-   * is custom element?
+   * Custom Element instance (if component is created by defineCustomElement)
    * @internal
    */
   ce?: ComponentCustomElementInterface
+  /**
+   * is custom element? (kept only for compatibility)
+   * @internal
+   */
+  isCE?: boolean
   /**
    * custom element specific HMR method
    * @internal

+ 1 - 0
packages/runtime-dom/src/apiCustomElement.ts

@@ -519,6 +519,7 @@ export class VueElement
       vnode.ce = instance => {
         this._instance = instance
         instance.ce = this
+        instance.isCE = true // for vue-i18n backwards compat
         // HMR
         if (__DEV__) {
           instance.ceReload = newStyles => {