提交 136c9308 编写于 作者: X xzs02

fix: 解决节点API在created生命周期内调用报错的问题。

上级 9fbefe3b
......@@ -71,11 +71,13 @@ function getNodeInfo (el, fields) {
function getNodesInfo (pageVm, component, selector, single, fields) {
const $el = pageVm.$el
if (single) {
const node = $el.matches(selector) ? $el : $el.querySelector(selector)
const node = $el && ($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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册