From 903b91e2bed88d6f5713e512c7ff26b478cd8e98 Mon Sep 17 00:00:00 2001 From: sunxiaobin89 <285584806@qq.com> Date: Thu, 27 Apr 2023 11:02:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=20table=20=E5=85=B3=E4=BA=8E?= =?UTF-8?q?=20`hideCol`=20=E7=94=A8=E6=B3=95=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hideCol的第二个参数实际是做了多种形式的适配,可以根据需要灵活传参应对不同的场景需求,支持显示或隐藏单列字段,同时操作多列的显示和隐藏,也支持直接显示或隐藏所有列 --- docs/table/index.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/table/index.md b/docs/table/index.md index a66831d4..877a82f1 100644 --- a/docs/table/index.md +++ b/docs/table/index.md @@ -458,6 +458,21 @@ table.hideCol('test', { field: 'title', // 对应表头的 field 属性值 hide: true // `true` or `false` }); + +// 同时设置多列的显示或隐藏 +table.hideCol('test', [{ + field: 'title1', + hide: true +}, { + field: 'title2', + hide: false +}, { + field: 'title3', + hide: false +}]); + +// 显示或隐藏全部 +table.hideCol('test', false); // `true` or `false` `true` 则隐藏全部一般没有实质的用处,通常会用到的场景是隐藏部分列之后想要重新恢复显示所有的时候会用到这种方式传参 `false` ```