documentation提供显示标签栏的选项( win.toggleTabBar()
)。但就我的一生而言,我只是无法让它发挥作用。
文档说“切换标签栏的可见性 如果启用了原生标签 ”。什么是原生标签?我如何启用它们。
我希望能够在 Electron 中显示标签栏。
最佳答案
根据 docs :
tabbingIdentifier String (optional) - Tab group name, allows opening the window as a native tab on macOS 10.12+. Windows with the same tabbing identifier will be grouped together. This also adds a native new tab button to your window's tab bar and allows your app and window to receive the new-window-for-tab event.
这是 added in 2017允许在 OSX 中使用“ native 选项卡”。为了让它工作,你必须通过
tabbingIdentifier
创建新的 BrowserWindow 时。const { BrowserWindow } = require('electron')
const win = new BrowserWindow({
tabbingIdentifier: 'myTabs'
});
关于javascript - win.toggleTabBar() 在 Electron 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59249853/