diff --git a/src/components/scFormTable/index.vue b/src/components/scFormTable/index.vue index 2392c2b0..821edeaa 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 { @@ -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){