This repository has been archived on 2025-01-09. You can view files and clone it, but cannot push or open issues or pull requests.

18 lines
520 B
JavaScript
Raw Normal View History

2025-01-09 18:30:49 +08:00
const { remote } = require('electron')
window.addEventListener('DOMContentLoaded', () => {
let oBtn = document.getElementById('btn')
oBtn.addEventListener('click', () => {
let subWin = new remote.BrowserWindow({
width: 200,
height: 200,
parent: remote.getCurrentWindow(), // 设置父窗口
modal: true, // 设置模态窗口
})
subWin.loadFile('sub.html')
subWin.on('close', () => {
subWin = null
})
})
})