From 035ebe51c394089db19401f68ddb3a7b8e1b02c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8C=AB=E5=AD=90neko?= <815743831@qq.com> Date: Fri, 19 Nov 2021 17:51:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=B9=E7=AC=AC=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E4=B8=80=E5=88=97=E7=9A=84=E5=B7=A6=E4=BE=A7=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=97=E6=97=B6=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=87=BA=E6=9D=A5?= =?UTF-8?q?=E7=9A=84=E5=88=97=E6=95=B0=E6=8D=AE=E4=BC=9A=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/global/extend.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/global/extend.js b/src/global/extend.js index ad8f182..f45277c 100644 --- a/src/global/extend.js +++ b/src/global/extend.js @@ -638,8 +638,9 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) { let row = [], curRow = [...d][index] for(let c = 0; c < d[0].length; c++){ + // *这个地方的Store.defaultCell不能使用引用. let cell = curRow[c], - templateCell = cell ? {...cell, v: '', m: ''} : Store.defaultCell; + templateCell = cell ? { ...cell, v: '', m: '' } : JSON.parse(JSON.stringify(Store.defaultCell)); delete templateCell.ps; row.push(templateCell); } @@ -812,8 +813,9 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) { let col = [], curd= [...d]; for(let r = 0; r < d.length; r++){ + // *这个地方的Store.defaultCell不能使用引用. let cell = curd[r][index], - templateCell = cell ? {...cell, v: '', m: ''} : Store.defaultCell; + templateCell = cell ? { ...cell, v: '', m: '' } : JSON.parse(JSON.stringify(Store.defaultCell)); delete templateCell.ps; col.push(templateCell); }