소스 검색

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

Evan You 1 년 전
부모
커밋
e19fc27042
2개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      packages/runtime-core/src/component.ts
  2. 1 0
      packages/runtime-dom/src/apiCustomElement.ts

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

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

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

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