主屏容器补充异常处理, 添加分页错误提醒;调整主屏容器加载时, 对不在连续分页上添加元素的情况进行处理
This commit is contained in:
parent
db7c1bddb5
commit
dd79744941
|
@ -748,10 +748,25 @@ export class GaiaContainer extends StarBaseElement {
|
|||
element: HTMLElement,
|
||||
direction: 'front' | 'back' | 'two-way' = 'two-way'
|
||||
) {
|
||||
if (pagination < 0) return
|
||||
if (pagination < 0) {
|
||||
console.error('The pagination should be a natural number!')
|
||||
return
|
||||
} else if (pagination >= this.pages._limit) {
|
||||
console.error(
|
||||
'The pagination has exceeded the limit, pagination:',
|
||||
pagination,
|
||||
'. The pagination up to:',
|
||||
this.pages._limit
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
let page = this.pages[pagination]
|
||||
if (!page) {
|
||||
page = this.addPage()!
|
||||
while (pagination > this.pages.length - 1) {
|
||||
page = this.addPage()!
|
||||
}
|
||||
|
||||
if (!page) {
|
||||
console.error('Append child error!')
|
||||
return
|
||||
|
@ -1488,7 +1503,7 @@ export class GaiaContainer extends StarBaseElement {
|
|||
}
|
||||
|
||||
continueDrag() {
|
||||
if (!this._dnd.active || !this._dnd.child) {
|
||||
if (!this._dnd.active || !this._dnd.child || !this['drag-and-drop']) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue