From 1d408f0f4a50911d28d84ec33976813ed6238abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Tue, 28 Nov 2023 10:25:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20table=20=E5=BD=93=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=80=BC=E4=B8=BA=20`0,undefined,null`=20=E4=B8=94?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=88=97=E6=A8=A1=E6=9D=BF=EF=BC=8C=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=8D=95=E5=85=83=E6=A0=BC=E4=BC=9A=E5=B8=A6=E5=85=A5?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=AD=97=E7=AC=A6=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20=E8=A7=A3=E5=86=B3=EF=BC=9A[#I8JOSW](https://gitee.com/layui?= =?UTF-8?q?/layui/issues/I8JOSW)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/table.js b/src/modules/table.js index 0db61e3c..3990c889 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -2379,8 +2379,9 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ } return inputElem; }()); - - input[0].value = othis.data('content') || data[field] || elemCell.text(); + input[0].value = function(val) { + return (val === undefined || val === null) ? '' : val; + }(othis.data('content') || data[field]); othis.find('.'+ELEM_EDIT)[0] || othis.append(input); input.focus(); e && layui.stope(e);