From 831c33cb981600e582c6e8c0bf41689d9baf2d83 Mon Sep 17 00:00:00 2001 From: shijing Date: Fri, 25 Apr 2025 16:02:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B7=BB=E5=8A=A0=E6=97=B6=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E4=B8=80=E8=A1=8C=E5=8F=AF=E9=80=89=E6=8B=A9=E5=9C=A8?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E8=A1=8C=E6=88=96=E8=80=85=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/scFormTable/index.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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)