You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
503 B

6 years ago
# 按鼠标中键关闭标签
这一个demo使用了一些内置api,你需要查阅[](dddl)
## js
```
// 提供鼠标中键关闭标签页,类似浏览器交互
BI.Plugin.registerObject("dec.workbench.tabs.button", function (widget) {
// 绑定鼠标中键事件
widget.element.mousedown(function (event) {
if (event.button === 1) {
// 调用tabPane api 关闭tab
BI.Services.getService("dec.service.tabs").closeTab(widget.getValue());
}
});
});
```