|
|
@@ -1041,19 +1041,23 @@ export class CanvasPhotoEditor {
|
|
|
const layout = this.getItemSize()
|
|
|
// if (this.selectedPageIndex === -1) return this.pages
|
|
|
const newPages = [...this.pages]
|
|
|
- // const PageIndex = direction ? this.selectedPageIndex + 1 : this.selectedPageIndex;
|
|
|
- // newPages.splice(PageIndex, 0, {
|
|
|
- // list: [],
|
|
|
- // layoutMode: this.layoutMode, //页码布局类型
|
|
|
- // coordinate: [], //坐标信息
|
|
|
- // })
|
|
|
- this.pages = [...newPages, {
|
|
|
- list: [],
|
|
|
- layoutMode: this.layoutMode, //页码布局类型
|
|
|
- coordinate: [], //坐标信息
|
|
|
- }]
|
|
|
- // if (!direction) this.selectedPageIndex++
|
|
|
- this.resetPosition()
|
|
|
+ if(direction === undefined){
|
|
|
+ this.pages = [...newPages, {
|
|
|
+ list: [],
|
|
|
+ layoutMode: this.layoutMode, //页码布局类型
|
|
|
+ coordinate: [], //坐标信息
|
|
|
+ }]
|
|
|
+ }else{
|
|
|
+ const PageIndex = direction ? this.selectedPageIndex + 1 : this.selectedPageIndex;
|
|
|
+ newPages.splice(PageIndex, 0, {
|
|
|
+ list: [],
|
|
|
+ layoutMode: this.layoutMode, //页码布局类型
|
|
|
+ coordinate: [], //坐标信息
|
|
|
+ })
|
|
|
+ if (!direction) this.selectedPageIndex++
|
|
|
+ this.pages = newPages
|
|
|
+ }
|
|
|
+ // this.resetPosition()
|
|
|
return this.pages
|
|
|
}
|
|
|
setPageType(direction) {
|