You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportfunctioninstall(Vue: VueConstructor){if(isVueRegistered(Vue)){if(__DEV__){warn('[vue-composition-api] already installed. Vue.use(VueCompositionAPI) should be called only once.')}return}// ....}
import CompositionAPI from '@vue/composition-api
),会触发插件中的如下代码:isVueRegistered
,代码如下:isVueRegistered
方法isVueRegistered
方法会返回 trueinstall
方法无法继续往下执行,也就是说子应用 C 中的 vueConstructor 变量是 nullVue
上注册了,但是当切换到子应用 C 时由于 install 被提前终止,导致下面的setVueConstructor
没有执行,所以vueConstructor
变量是 null,代码如下:reactive
,执行过程如下:=============================================================================================
针对以上问题,有如下解决办法,可以增强
isVueRegistered
方法的判断能力,比如:目前通过给插件 打补丁 的方式在业务中运行该方案,经验证是可行的,也没发现什么副作用,composition-api 的单元测试也能正常跑过
The text was updated successfully, but these errors were encountered: