主屏图标容器添加页面跳转功能

This commit is contained in:
luojiahao 2022-12-03 13:50:48 +08:00
parent 77dda47765
commit c96a3ee1d7
1 changed files with 11 additions and 0 deletions

View File

@ -388,6 +388,17 @@ export class GaiaContainer extends StarBaseElement {
this.resetView(type, this.pagination, callback)
}
turnTo(pagination: number) {
if (pagination < 0) {
pagination = 0
} else if (pagination >= this.pages.length) {
pagination = this.pages.length - 1
}
const page = this.pages[pagination]
this.smoothSlide(page, 'panend')
}
resetView(
type: string,
pagination = this.pagination,