提交 4d8c89d3 编写于 作者: fxy060608's avatar fxy060608

fix(v3): ignore comment element (requestComponentInfo)

上级 548a67ce
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -84,14 +84,15 @@ function getNodeInfo (el, fields) {
function getNodesInfo (pageVm, component, selector, single, fields) {
const $el = findElm(component, pageVm)
if (!$el || ($el && $el.nodeType === 8)) { // Comment
return single ? null : []
}
if (single) {
const node = $el && ($el.matches(selector) ? $el : $el.querySelector(selector))
const node = $el.matches(selector) ? $el : $el.querySelector(selector)
if (node) {
return getNodeInfo(node, fields)
}
return null
} else if (!$el) {
return []
} else {
let infos = []
const nodeList = $el.querySelectorAll(selector)
......@@ -139,4 +140,4 @@ export function requestComponentInfo ({
reqId,
res: result
}, pageVm.$page.id)
}
}
......@@ -7,7 +7,7 @@ import {
export default function initVue (Vue) {
Vue.config.errorHandler = function (err) {
const app = getApp()
const app = typeof getApp === 'function' && getApp()
if (app && hasLifecycleHook(app.$options, 'onError')) {
app.__call_hook('onError', err)
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册