From d04ae6c073ac916352a016ff7132e4320f5fa7e3 Mon Sep 17 00:00:00 2001 From: thinkdream Date: Tue, 26 Sep 2023 02:47:37 +0000 Subject: [PATCH] =?UTF-8?q?update=20src/components/scFormTable/index.vue.?= =?UTF-8?q?=20=E5=9C=A8cart=E7=BB=84=E4=BB=B6=E4=B8=AD=E4=BD=BF=E7=94=A8sc?= =?UTF-8?q?tableform=EF=BC=8C=E6=97=A0=E6=B3=95=E8=BE=BE=E6=88=90=E5=AE=8C?= =?UTF-8?q?=E7=BE=8E=E8=87=AA=E9=80=82=E5=BA=94=EF=BC=8C=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=AF=B9=E9=83=A8=E5=88=86css=E5=86=85=E5=AE=B9=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E8=B0=83=E6=95=B4=E3=80=82=20=E5=9C=A8=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E8=BF=87=E7=A8=8B=E4=B8=AD=EF=BC=8C=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=86=85=E5=AE=B9=E7=9A=84=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E6=98=AF=E6=9C=89=E4=B8=8A=E9=99=90=E7=9A=84=EF=BC=8C=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=AF=B9=E5=86=85=E5=AE=B9=E8=BF=9B=E8=A1=8C=E9=99=90?= =?UTF-8?q?=E5=88=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: thinkdream --- src/components/scFormTable/index.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/scFormTable/index.vue b/src/components/scFormTable/index.vue index cb44888..3a13f67 100644 --- a/src/components/scFormTable/index.vue +++ b/src/components/scFormTable/index.vue @@ -45,6 +45,7 @@ dragSort: { type: Boolean, default: false }, hideAdd: { type: Boolean, default: false }, hideDelete: { type: Boolean, default: false } + limitRow:{type:Number}, }, data(){ return { @@ -93,6 +94,7 @@ }) }, rowAdd(){ + if (this.modelValue.length+1 > this.limitRow) { return ''; } const temp = JSON.parse(JSON.stringify(this.addTemplate)) this.data.push(temp) }, @@ -101,6 +103,9 @@ }, //插入行 pushRow(row){ + if(this.limitRow > 0){ + if (this.modelValue.length+1 > this.limitRow) { return ''; } + } const temp = row || JSON.parse(JSON.stringify(this.addTemplate)) this.data.push(temp) }, @@ -114,6 +119,7 @@