@mpxjs/api-proxy 2.10.18-beta.1 → 2.10.18-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/api-proxy",
3
- "version": "2.10.18-beta.1",
3
+ "version": "2.10.18-beta.12",
4
4
  "description": "convert miniprogram API at each end",
5
5
  "module": "src/index.js",
6
6
  "types": "@types/index.d.ts",
@@ -74,10 +74,18 @@ class RNIntersectionObserver {
74
74
  return
75
75
  }
76
76
  let targetRef = null
77
- if (this.observeAll) {
78
- targetRef = this.component.__selectRef(selector, 'node', true)
79
- } else {
80
- targetRef = this.component.__selectRef(selector, 'node')
77
+ // 支持传递 ref 对象或数组
78
+ if (isArray(selector)) {
79
+ const refs = selector.map(item => item.nodeRefs?.[0]).filter(Boolean)
80
+ targetRef = this.observeAll ? refs : refs[0]
81
+ } else if (isObject(selector)) {
82
+ targetRef = selector.nodeRefs?.[0]
83
+ } else if (isString(selector)) {
84
+ if (this.observeAll) {
85
+ targetRef = this.component.__selectRef(selector, 'node', true)
86
+ } else {
87
+ targetRef = this.component.__selectRef(selector, 'node')
88
+ }
81
89
  }
82
90
  if (!targetRef || targetRef.length === 0) {
83
91
  warn('intersection observer target not found', this.mpxFileResource)