From ef25f75c2ae02d51d4663021172f627b0cb5ff60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Wed, 31 May 2023 22:07:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20`treeTable.reAsync()`?= =?UTF-8?q?=20=E6=96=B9=E6=B3=95=E5=90=8D=E4=B8=BA=20`treeTable.reloadAsyn?= =?UTF-8?q?cNode()`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/treeTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/treeTable.js b/src/modules/treeTable.js index 92a90c84..6e9f5f11 100644 --- a/src/modules/treeTable.js +++ b/src/modules/treeTable.js @@ -1766,7 +1766,7 @@ layui.define(['table'], function (exports) { * @param {String} id 表格id * @param {String} dataIndex 父节点的dataIndex * */ - treeTable.reAsync = function (id, dataIndex) { + treeTable.reloadAsyncNode = function (id, dataIndex) { var that = getThisTable(id); if (!that) { return; From 79d90fae433af24f22157f84e36b6ca629a37702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Wed, 31 May 2023 22:08:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=8C=E5=96=84=20`table.set()`=20?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=BB=8B=E7=BB=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/table/index.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/table/index.md b/docs/table/index.md index 2e55b295..d7734080 100644 --- a/docs/table/index.md +++ b/docs/table/index.md @@ -20,6 +20,7 @@ toc: true | API | 描述 | | --- | --- | | var table = layui.table | 获得 `table` 模块。 | +| [table.set(options)](#set) | 设定全局默认属性项 | | [table.render(options)](#render) | table 组件渲染,核心方法。 | | [table.init(filter, options)](#table.init) | 初始化渲染静态表格。 | | [table.reload(id, options, deep)](#table.reload) | 表格完整重载。 | @@ -35,6 +36,25 @@ toc: true | [table.on(\'event(filter)\', callback)](#table.on) | table 相关事件。 | +

全局设置

+ +- 参数 `options` : 基础属性配置项。[#详见属性](#options) + +该方法主要用于初始化设置属性默认值。实际应用时,必须先设置该方法,再执行渲染、重载等操作。 + +```js +layui.use(function(){ + var table = layui.table; + // 全局设置 + table.set({ + headers: {token: '123'} + }); + // 渲染 + table.render(options); +}); +``` + +

渲染

table 提供了以下三种渲染模式,在实际使用时,一般按情况选择其中一种即可。