提交 27ead72a 编写于 作者: H hadi

fix(uni-mp-xhs): fix the issue of `useRef` component being undefined in the xhs platform in Vue 3

上级 ff175b7a
......@@ -905,19 +905,23 @@ function initCreatePage() {
};
// 初始化 vue 实例
this.props = query;
this.$vm = createVueComponent('page', this, vueOptions);
initSpecialMethods(this);
this.$vm.$callHook(ON_LOAD, query);
},
onShow() {
if (this.$vm) {
this.$vm.$callHook(ON_SHOW);
}
if (__VUE_PROD_DEVTOOLS__) {
devtoolsComponentAdded(this.$vm.$);
}
this.$vm.$callHook(ON_SHOW);
},
onReady() {
this.$vm.$callHook('mounted');
this.$vm.$callHook(ON_READY);
this.$vm = createVueComponent("page", this, vueOptions);
this.$vm.$callHook("mounted");
this.$vm.$callHook(ON_LOAD, this.options);
initSpecialMethods(this);
setTimeout(() => {
this.$vm.$callHook(ON_READY);
});
},
onUnload() {
if (this.$vm) {
......
......@@ -46,19 +46,23 @@ export function initCreatePage() {
}
// 初始化 vue 实例
this.props = query
this.$vm = createVueComponent('page', this, vueOptions)
initSpecialMethods(this)
this.$vm.$callHook(ON_LOAD, query)
},
onShow() {
if (this.$vm) {
this.$vm.$callHook(ON_SHOW)
}
if (__VUE_PROD_DEVTOOLS__) {
devtoolsComponentAdded(this.$vm.$)
}
this.$vm.$callHook(ON_SHOW)
},
onReady() {
this.$vm = createVueComponent('page', this, vueOptions)
this.$vm.$callHook('mounted')
this.$vm.$callHook(ON_READY)
this.$vm.$callHook(ON_LOAD, this.options)
initSpecialMethods(this)
setTimeout(() => {
this.$vm.$callHook(ON_READY)
})
},
onUnload() {
if (this.$vm) {
......
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
overrides:
'@babel/plugin-transform-block-scoping': 7.19.4
......@@ -10912,3 +10908,7 @@ packages:
optionalDependencies:
commander: 9.5.0
dev: true
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册