docs(tabs): 更正 tabs 文档错误 (#2896)

* Update index.md

* Update beforeChange.md

* Update beforeClose.md
This commit is contained in:
青崖
2025-10-28 19:16:57 +08:00
committed by GitHub
parent e86cdd349b
commit c9d6004bf8
3 changed files with 4 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ layui.use(function() {
layer.close(i); // 关闭确认框
});
// 阻止标签默认关闭
// 阻止标签默认切换
return false;
});
});

View File

@@ -27,7 +27,7 @@ layui.use(function() {
// 标签实例 ID
var DEMO_TABS_ID = 'demoTabsBeforeClose';
// tabs 切换前的事件
// tabs 关闭前的事件
tabs.on(`beforeClose(${DEMO_TABS_ID})`, function(data) {
console.log('beforeClose', data);

View File

@@ -302,7 +302,7 @@ tabs.on(`beforeChange(testID)`, function(data) {
console.log(data.to.index); // 切换后的选中标签索引
console.log(data.to.headerItem); // 切换后的选中标签头部项
// 阻止标签默认关闭
// 阻止标签默认切换
return false;
});
```
@@ -334,7 +334,7 @@ tabs.on('afterChange(testID)', function(data) {
`tabs.on('beforeClose(id)', callback)`
标签在切换前触发,通过在事件中 `return false` 可阻止默认标签切换行为。通常和 `tabs.close()` 方法搭配使用。
标签在关闭前触发,通过在事件中 `return false` 可阻止默认标签关闭行为。通常和 `tabs.close()` 方法搭配使用。
<pre class="layui-code" lay-options="{preview: true, layout: ['preview', 'code'], codeStyle: 'max-height: 520px;', tools: ['full'], done: function(obj){
obj.render();