diff --git a/docs/tab/detail/demo.md b/docs/tab/detail/demo.md index 1ef93127..ffeb37d2 100644 --- a/docs/tab/detail/demo.md +++ b/docs/tab/detail/demo.md @@ -37,7 +37,8 @@ layui.use(function(){ element.tabAdd('test-handle', { title: '新选项'+ label, content: '内容-'+ label, - id: new Date().getTime() // 实际使用一般是规定好的id,这里以时间戳模拟下 + id: new Date().getTime(), // 实际使用一般是规定好的id,这里以毫秒数模拟 + change: true // 是否添加完毕后即自动切换 }) }, tabDelete: function(othis){ diff --git a/docs/tab/index.md b/docs/tab/index.md index 436e27da..8c09df2f 100644 --- a/docs/tab/index.md +++ b/docs/tab/index.md @@ -182,11 +182,12 @@ layui.use(function(){ - 参数 `filter` : tab 容器(`class="layui-tab"`)的 `lay-filter` 属性值 - 参数 `options` : 添加 tab 时的属性可选项,见下表: -| options | 描述 | 类型 | -| --- | --- | --- | -| title | 选项卡的标题 | string | -| content | 选项卡的内容,支持传入 `html` | string | -| id | 选项卡标题元素的 `lay-id` 属性值 | string | +| options | 描述 | 类型 | 默认 | +| --- | --- | --- | --- | +| title | 选项卡的标题 | string | - | +| content | 选项卡的内容,支持传入 `html` | string | - | +| id | 选项卡标题元素的 `lay-id` 属性值 | string | - | +| change | 是否添加 tab 完毕后即自动切换 | boolean | `false` | 该方法用于添加 tab 选项。用法详见 : [#示例](#examples)