From ec4f0c7b3f4c3672979616c1a8a08b486bf816cc Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Mon, 1 Apr 2024 19:47:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20uni-recycle-view=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=BAuni=5Fmodules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-long-list/custom-long-list.uvue | 14 +--- uni_modules/uni-recycle-view/changelog.md | 0 .../uni-recycle-item/uni-recycle-item.uvue | 11 ++- .../uni-recycle-view/uni-recycle-view.uvue | 17 ++-- uni_modules/uni-recycle-view/package.json | 84 +++++++++++++++++++ .../uni-recycle-view/readme.md | 9 +- 6 files changed, 110 insertions(+), 25 deletions(-) create mode 100644 uni_modules/uni-recycle-view/changelog.md rename pages/template/custom-long-list/custom-list-item.uvue => uni_modules/uni-recycle-view/components/uni-recycle-item/uni-recycle-item.uvue (59%) rename pages/template/custom-long-list/custom-list-view.uvue => uni_modules/uni-recycle-view/components/uni-recycle-view/uni-recycle-view.uvue (89%) create mode 100644 uni_modules/uni-recycle-view/package.json rename pages/template/custom-long-list/README.md => uni_modules/uni-recycle-view/readme.md (95%) diff --git a/pages/template/custom-long-list/custom-long-list.uvue b/pages/template/custom-long-list/custom-long-list.uvue index 35b53e2b..73635b79 100644 --- a/pages/template/custom-long-list/custom-long-list.uvue +++ b/pages/template/custom-long-list/custom-long-list.uvue @@ -3,16 +3,16 @@ list-view组件虽然在UI层有recycle机制,但长列表的vnode太多也会造成初始化卡顿。本组件仅创建部分vnode,而未使用list-view,也就是UI层其实是短列表。 此示例中仅渲染滚动容器上下5屏的内容。适用于仅使用一个for循环创建所有列表项的场景。 - + - + @@ -22,13 +22,7 @@ name : string info : string } - import CustomListView from "./custom-list-view" - import CustomListItem from "./custom-list-item" export default { - components: { - CustomListView, - CustomListItem - }, data() { return { title: '自行实现长列表组件', diff --git a/uni_modules/uni-recycle-view/changelog.md b/uni_modules/uni-recycle-view/changelog.md new file mode 100644 index 00000000..e69de29b diff --git a/pages/template/custom-long-list/custom-list-item.uvue b/uni_modules/uni-recycle-view/components/uni-recycle-item/uni-recycle-item.uvue similarity index 59% rename from pages/template/custom-long-list/custom-list-item.uvue rename to uni_modules/uni-recycle-view/components/uni-recycle-item/uni-recycle-item.uvue index b95c44ef..6a51a7f6 100644 --- a/pages/template/custom-long-list/custom-list-item.uvue +++ b/uni_modules/uni-recycle-view/components/uni-recycle-item/uni-recycle-item.uvue @@ -1,10 +1,15 @@