fix:scFormTable增加pushType传输

This commit is contained in:
shijing 2025-07-03 16:38:22 +08:00
parent f986cd8d59
commit 2703a2a1a3
1 changed files with 8 additions and 3 deletions

View File

@ -49,7 +49,8 @@
dragSort: { type: Boolean, default: false },
hideAdd: { 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(){
return {
@ -98,8 +99,12 @@
})
},
rowAdd(){
const temp = JSON.parse(JSON.stringify(this.addTemplate))
this.data.push(temp);
const temp = JSON.parse(JSON.stringify(this.addTemplate));
if(this.pushType == 'unshift'){
this.data.unshift(temp);
}else{
this.data.push(temp);
}
this.$emit('add', temp)
},
rowDel(row, index){