Commit 2de1aa8cfd49caa4b1cc41ca3983e04dbe6d0331

Authored by ly525
1 parent e2840ab4

fix: fix the object will be copied is not passed to the clone function & set a d…

…efault value for zindex
front-end/h5/src/components/core/models/element.js
@@ -107,7 +107,7 @@ class Element { @@ -107,7 +107,7 @@ class Element {
107 return data 107 return data
108 } 108 }
109 109
110 - clone ({ zindex }) { 110 + clone ({ zindex = this.commonStyle.zindex + 1 } = {}) {
111 return new Element({ 111 return new Element({
112 zindex, 112 zindex,
113 name: this.name, 113 name: this.name,
front-end/h5/src/store/modules/element.js
@@ -52,7 +52,7 @@ export const mutations = { @@ -52,7 +52,7 @@ export const mutations = {
52 elements.push(element) 52 elements.push(element)
53 break 53 break
54 case 'copy': 54 case 'copy':
55 - elements.push(state.editingElement.clone()) 55 + elements.push(state.editingElement.clone({ zindex: len + 1 }))
56 break 56 break
57 case 'delete': 57 case 'delete':
58 { 58 {