diff --git a/src/components/scFormTable/index.vue b/src/components/scFormTable/index.vue index 16fa394b..39e072df 100644 --- a/src/components/scFormTable/index.vue +++ b/src/components/scFormTable/index.vue @@ -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 { @@ -99,7 +100,12 @@ }, rowAdd(){ 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){ this.data.splice(index, 1)