fix:添加时最新一行可选择在第一行或者最后一行
This commit is contained in:
parent
4c5f393a2d
commit
831c33cb98
|
|
@ -49,7 +49,8 @@
|
||||||
dragSort: { type: Boolean, default: false },
|
dragSort: { type: Boolean, default: false },
|
||||||
hideAdd: { type: Boolean, default: false },
|
hideAdd: { type: Boolean, default: false },
|
||||||
hideDelete: { type: Boolean, default: false },
|
hideDelete: { type: Boolean, default: false },
|
||||||
hideIndex: { type: Boolean, default: false }
|
hideIndex: { type: Boolean, default: false },
|
||||||
|
pushType: { type: String, default: 'push' }
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
|
|
@ -99,7 +100,12 @@
|
||||||
},
|
},
|
||||||
rowAdd(){
|
rowAdd(){
|
||||||
const temp = JSON.parse(JSON.stringify(this.addTemplate))
|
const temp = JSON.parse(JSON.stringify(this.addTemplate))
|
||||||
this.data.push(temp)
|
if(this.pushType=='push'){
|
||||||
|
this.data.push(temp)
|
||||||
|
}else if(this.pushType=='unshift'){
|
||||||
|
this.data.unshift(temp)
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
rowDel(row, index){
|
rowDel(row, index){
|
||||||
this.data.splice(index, 1)
|
this.data.splice(index, 1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue