mirror of
https://github.com/568071718/creator-collection-view
synced 2025-12-19 10:29:35 +00:00
更新 README
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -298,6 +298,7 @@
|
||||
"preloadNodesLimitPerFrame": 2,
|
||||
"frameInterval": 1,
|
||||
"recycleInterval": 1,
|
||||
"autoReloadOnSizeChange": false,
|
||||
"registerCellForEditor": [
|
||||
{
|
||||
"__id__": 8
|
||||
|
||||
@@ -298,6 +298,7 @@
|
||||
"preloadNodesLimitPerFrame": 2,
|
||||
"frameInterval": 1,
|
||||
"recycleInterval": 1,
|
||||
"autoReloadOnSizeChange": false,
|
||||
"registerCellForEditor": [
|
||||
{
|
||||
"__id__": 8
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user