Skip to content

支持observe可以传入refs#2478

Open
thuman wants to merge 1 commit intomasterfrom
feat-observerefs
Open

支持observe可以传入refs#2478
thuman wants to merge 1 commit intomasterfrom
feat-observerefs

Conversation

@thuman
Copy link
Copy Markdown
Collaborator

@thuman thuman commented May 6, 2026

No description provided.

targetRef = this.component.__selectRef(selector, 'node')
// 支持传递 ref 对象或数组
if (isArray(selector)) {
const refs = selector.map(item => item.nodeRefs?.[0]).filter(Boolean)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你接收的是mpx提供的this.$refs.xxx?,这个nodeRefs本身就是一个数组,为什么只取第一个?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants