现在有一个nw窗口a,需要使用API打开另外一个nw窗口b,且窗口b内可以调用nodejs及对窗口的操作的API。
package.json
{
"name": "node-webkit menu demo",
"main": "index.html",
"version": 1.1,
"window": {
"show": false,
"position": "center",
"single-instance": false,
"width": 500,
"toolbar":true,
"frame":true,
"node-remote":"",
"height": 500
}
}
打开子窗口
function openChildWindow() {
var url = "http://localhost:3900/file/1";
var docWindowOptions = {
"new-instance": true,
"show_in_taskbar":true,
//"toolbar":false,
"show": true
};
require('nw.gui').Window.open(url,docWindowOptions)
}
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
认证0级讲师