From dd000d875282113fa70925f5d4c182b5f26a9fc6 Mon Sep 17 00:00:00 2001 From: xujiujiu <906784584@qq.com> Date: Mon, 11 Sep 2023 19:25:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20relations=20=E5=86=99=E6=B3=95?= =?UTF-8?q?=E9=94=99=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recycle-view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/recycle-view.js b/src/recycle-view.js index e0bfe8a..d9ce1ce 100644 --- a/src/recycle-view.js +++ b/src/recycle-view.js @@ -11,7 +11,7 @@ Component({ multipleSlots: true // 在组件定义时的选项中启用多slot支持 }, relations: { - '../recycle-item/recycle-item': { + './recycle-item': { type: 'child', // 关联的目标节点应为子节点 linked(target) { // 检查第一个的尺寸就好了吧 From 310556b964a473b5b8f51dd3a5003856dfa82bd1 Mon Sep 17 00:00:00 2001 From: xujiujiu <906784584@qq.com> Date: Mon, 11 Sep 2023 19:40:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20this.=5Fpos=20=E6=97=A0=E5=80=BC?= =?UTF-8?q?=E6=97=B6=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recycle-view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/recycle-view.js b/src/recycle-view.js index d9ce1ce..495319b 100644 --- a/src/recycle-view.js +++ b/src/recycle-view.js @@ -17,7 +17,7 @@ Component({ // 检查第一个的尺寸就好了吧 if (!this._hasCheckSize) { this._hasCheckSize = true - const size = this.boundingClientRect(this._pos.beginIndex) + const size = this._pos && this.boundingClientRect(this._pos.beginIndex) if (!size) { return }