fix:scFormTable增加pushType传输
This commit is contained in:
parent
f986cd8d59
commit
2703a2a1a3
|
@ -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 {
|
||||||
|
@ -98,8 +99,12 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
rowAdd(){
|
rowAdd(){
|
||||||
const temp = JSON.parse(JSON.stringify(this.addTemplate))
|
const temp = JSON.parse(JSON.stringify(this.addTemplate));
|
||||||
|
if(this.pushType == 'unshift'){
|
||||||
|
this.data.unshift(temp);
|
||||||
|
}else{
|
||||||
this.data.push(temp);
|
this.data.push(temp);
|
||||||
|
}
|
||||||
this.$emit('add', temp)
|
this.$emit('add', temp)
|
||||||
},
|
},
|
||||||
rowDel(row, index){
|
rowDel(row, index){
|
||||||
|
|
Loading…
Reference in New Issue