更新 README

This commit is contained in:
o.o.c.
2025-12-09 00:08:16 +08:00
parent 493a02d981
commit d9405c8584
21 changed files with 124 additions and 1647 deletions

View File

@@ -8,6 +8,7 @@ export class page_view extends Component {
protected start(): void {
const listComp = this.node.getChildByName('list').getComponent(YXCollectionView)
listComp.recycleInterval = 0
listComp.ignoreScrollEndedDuringAutoScroll = true
listComp.numberOfItems = () => {
return 3

View File

@@ -298,6 +298,7 @@
"preloadNodesLimitPerFrame": 2,
"frameInterval": 1,
"recycleInterval": 1,
"autoReloadOnSizeChange": false,
"registerCellForEditor": [
{
"__id__": 8

View File

@@ -298,6 +298,7 @@
"preloadNodesLimitPerFrame": 2,
"frameInterval": 1,
"recycleInterval": 1,
"autoReloadOnSizeChange": false,
"registerCellForEditor": [
{
"__id__": 8

View File

@@ -8,6 +8,7 @@ export class table_in_page extends Component {
protected start(): void {
const listComp = this.node.getChildByName('list').getComponent(YXCollectionView)
listComp.recycleInterval = 0
listComp.ignoreScrollEndedDuringAutoScroll = true
listComp.numberOfItems = () => {
return 5

View File

@@ -17,10 +17,12 @@ export class PageLayout extends YXLayout {
/**
* 循环滚动,默认关闭
* 注意: 当开启循环滚动时YXCollectionView 需要额外设置 `recycleInterval = 0`
* 注意: 当开启循环滚动时YXCollectionView 需要额外设置 `ignoreScrollEndedDuringAutoScroll = true`
* 注意: 开启循环滚动会生成较大范围的 `indexPath`,在使用索引的时候需要进行取余处理
*
* @example
* listComp.recycleInterval = 0
* listComp.ignoreScrollEndedDuringAutoScroll = true
* listComp.numberOfItems = () => {
* return <data-length>
@@ -61,6 +63,9 @@ export class PageLayout extends YXLayout {
let numberOfItems = collectionView.getNumberOfItems(0)
if (this.loop) {
numberOfItems = numberOfItems * 3 * this.safeScrollRangeMultiplier
if (collectionView.recycleInterval != 0) {
warn(`PageLayout: 开启循环滚动时建议将 YXCollectionView.recycleInterval 设置为 0`)
}
if (collectionView.ignoreScrollEndedDuringAutoScroll == false) {
warn(`PageLayout: 开启循环滚动时建议将 YXCollectionView.ignoreScrollEndedDuringAutoScroll 设置为 true`)
}