提交 91c34207 编写于 作者: Q qiang

fix(x-ios): 调整vue组件实例判断方式

上级 921e74ad
...@@ -1858,9 +1858,8 @@ var getElementById = /* @__PURE__ */ defineSyncApi("getElementById", (id2) => { ...@@ -1858,9 +1858,8 @@ var getElementById = /* @__PURE__ */ defineSyncApi("getElementById", (id2) => {
}); });
function isVueComponent(comp) { function isVueComponent(comp) {
var has$option = typeof comp.$ === "object"; var has$option = typeof comp.$ === "object";
var has$nativePage = typeof comp.$nativePage === "object"; var has$el = typeof comp.$el === "object";
var has$mpType = typeof comp.$mpType === "string"; return has$option && has$el;
return has$option && has$nativePage && has$mpType;
} }
var isFunction = (val) => typeof val === "function"; var isFunction = (val) => typeof val === "function";
class NodesRefImpl { class NodesRefImpl {
......
...@@ -11,11 +11,10 @@ import { getCurrentPage } from '@dcloudio/uni-core' ...@@ -11,11 +11,10 @@ import { getCurrentPage } from '@dcloudio/uni-core'
import type { ComponentPublicInstance } from 'vue' import type { ComponentPublicInstance } from 'vue'
function isVueComponent(comp: any) { function isVueComponent(comp: any) {
const has$option = typeof comp.$ === 'object' const has$instance = typeof comp.$ === 'object'
const has$nativePage = typeof comp.$nativePage === 'object' const has$el = typeof comp.$el === 'object'
const has$mpType = typeof comp.$mpType === 'string'
return has$option && has$nativePage && has$mpType return has$instance && has$el
} }
const isFunction = (val: any): val is Function => typeof val === 'function' const isFunction = (val: any): val is Function => typeof val === 'function'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册