niva
niva copied to clipboard
Mac 下调用接口 Niva.api.window.setMaximized 卡死
系统信息
工具版本 v0.9.10
文件 niva.json 的内容
{
"name": "niva-example",
"uuid": "51c1cba1-0811-4187-9525-41d75836bdeb",
"debug": {
"resource": "public",
"entry": "http://127.0.0.1:5173"
},
"build": {
"resource": "build"
},
"window": {
"title": "Devtools",
"size": {
"width": 900,
"height": 600
},
"resizable": true,
"devtools": true
},
"macos": {
"window": {
"titleBarTransparent": true,
"titleBarButtonsHidden": true,
"titleHidden": true,
"fullSizeContentView": true
}
},
"windows": {
"window": {
"undecoratedShadow": true,
"decorations": false
}
}
}
入口文件 index.html 的内容:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
</head>
<body>
<div id="app">
<button id="maximize">set to maximized</button>
</div>
<script>
document.querySelector('#maximize').addEventListener("click", (e) => {
e.preventDefault()
Niva.api.window.setMaximized(true) // 这里会卡死
})
</script>
</body>
</html>