From 2703a2a1a31b8104210f552a4ae669648916c565 Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 3 Jul 2025 16:38:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:scFormTable=E5=A2=9E=E5=8A=A0pushType?= =?UTF-8?q?=E4=BC=A0=E8=BE=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/scFormTable/index.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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){