修复轮播图编辑器

This commit is contained in:
aixianling
2023-10-09 17:37:22 +08:00
parent 3a9377fe4b
commit 1b2348ef73
3 changed files with 32 additions and 23 deletions

View File

@@ -294,6 +294,7 @@ export default {
},
currLayout: {
set(v) {
console.log(v)
this.componentList.splice(this.activeIndex, 1, v)
},
get() {
@@ -351,7 +352,7 @@ export default {
this.form.images = []
this.isShowAddImg = false
},
//置顶图层
setTop() {
const maxZindex = Math.max.apply(Math, this.componentList.map(item => {
return item.zIndex
@@ -359,7 +360,7 @@ export default {
this.$set(this.componentList[this.activeIndex], 'zIndex', maxZindex + 1)
},
//置底图层
setBottom() {
const item = this.componentList[this.activeIndex]
this.componentList.splice(this.activeIndex, 1)
@@ -404,6 +405,7 @@ export default {
}
})
},
//从资产中新建时使用
clone(e) {
this.componentList.push(this.deepClone(e))
},
@@ -456,12 +458,12 @@ export default {
e.preventDefault()
},
//复制图层功能
copyLayer() {
const layer = this.deepClone(this.componentList[this.activeIndex])
this.componentList.push(layer)
},
//删除图层功能
removeLayer() {
this.componentList.splice(this.activeIndex, 1)
this.activeIndex = -1