File tree Expand file tree Collapse file tree
playground/page/browser/window-type/markdown Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212// @@code-props: { hideRight: true, height:'100px' }
1313const { BrowserWindow } = require (' electron' )
1414let win = new BrowserWindow ({ width: 800 , height: 600 , frame: false })
15- win .show ( )
15+ win .loadURL ( ' https://www.github.com ' )
1616```
1717在` macOS ` 下,还有不同的实现方式,[ 完整文档] ( https://www.electronjs.org/docs/api/frameless-window#macos-%E4%B8%8A%E7%9A%84%E5%85%B6%E4%BB%96%E6%96%B9%E6%A1%88 )
1818
@@ -28,7 +28,7 @@ win.show()
2828// 创建一个无边框的窗口
2929const { BrowserWindow } = require (' electron' )
3030let win = new BrowserWindow ({ titleBarStyle: ' hidden' })
31- win .show ( )
31+ win .loadURL ( ' https://www.github.com ' )
3232```
3333效果如下:
3434<img src =" ../../resources/markdown/window-type-frame.gif " alt =" window-type-frame " >
@@ -42,7 +42,7 @@ win.show()
4242// 创建一个无边框的窗口
4343const { BrowserWindow } = require (' electron' )
4444let win = new BrowserWindow ({ titleBarStyle: ' hiddenInset' })
45- win .show ( )
45+ win .loadURL ( ' https://www.github.com ' )
4646```
4747效果如下:
4848<img src =" ../../resources/markdown/window-type-frame2.gif " alt =" window-type-frame2 " >
Original file line number Diff line number Diff line change 1212// @@code-props: { hideRight: true, height:'100px' }
1313const { BrowserWindow } = require (' electron' )
1414let win = new BrowserWindow ({ width: 800 , height: 600 , frame: false })
15- win .show ( )
15+ win .loadURL ( ' https://github.com ' )
1616```
1717在` macOS ` 下,还有不同的实现方式,[ 完整文档] ( https://www.electronjs.org/docs/api/frameless-window#macos-%E4%B8%8A%E7%9A%84%E5%85%B6%E4%BB%96%E6%96%B9%E6%A1%88 )
1818
@@ -28,7 +28,7 @@ win.show()
2828// 创建一个无边框的窗口
2929const { BrowserWindow } = require (' electron' )
3030let win = new BrowserWindow ({ titleBarStyle: ' hidden' })
31- win .show ( )
31+ win .loadURL ( ' https://github.com ' )
3232```
3333效果如下:
3434<img src =" ../../resources/markdown/window-type-frame.gif " alt =" window-type-frame " >
@@ -42,7 +42,7 @@ win.show()
4242// 创建一个无边框的窗口
4343const { BrowserWindow } = require (' electron' )
4444let win = new BrowserWindow ({ titleBarStyle: ' hiddenInset' })
45- win .show ( )
45+ win .loadURL ( ' https://github.com ' )
4646```
4747效果如下:
4848<img src =" ../../resources/markdown/window-type-frame2.gif " alt =" window-type-frame2 " >
You can’t perform that action at this time.
0 commit comments