Skip to content

Commit

Permalink
fix: 解决节点API在created生命周期内调用报错的问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
dcloud-robot committed Jan 7, 2019
1 parent 9fbefe3 commit 136c930
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/view/bridge/subscribe/request-component-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 136c930

Please sign in to comment.