node.js - 使用 Electron BrowserWindow() 的电子滚动问题;
问题描述
我无法让我的电子应用程序允许滚动。请问有人可以帮我吗?下面是我的代码。对不起,我对电子还很陌生,并试图理解它。问题显示为浏览器窗口中的内容超出了窗口的末尾,我无法使用触控板或箭头键向下滚动。
function createWindow () {
server.run();
// Create the browser window.
mainWindow = new BrowserWindow({
width: 1024,
height: 768,
scrollBounce: false,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
zoomFactor: 0.8,
enableRemoteModule: false
},
frame: true,
minWidth: 1024,
minHeight: 768
});
// and load the index.html of the app.
mainWindow.loadURL('http://'+server.host+':'+server.port+'/')
/*
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'index.php'),
protocol: 'file:',
slashes: true
}))
*/
const {shell} = require('electron')
shell.showItemInFolder('fullPath')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
// PHP SERVER QUIT
server.close();
app.quit();
mainWindow = null;
})
}
解决方案
推荐阅读
- python - 在一行中将 n 个形状列表与 n 个形状数组元素相乘
- ios - 通过 SwiftyJSON 循环
- excel - 从多个文件的特定单元格中提取数据并显示在表格 POSH 中
- php - 更改导航和链接 URL?
- matomo - Matomo/Piwik:如何使用 Reporting API 获取特定时间范围内的数据?
- django - django ORM 如何处理成千上万的并发请求,因为它是同步的?
- java - 如何实现复杂的动画?
- java - 在 Android 10 上安装更新同一应用的 apk 失败;java.lang.SecurityException:文件仍然打开
- shared-memory - 重新设计带有消息传递的共享内存分布式系统
- angular - 上传文件时,内容类型发送为“multipart/form-data”时找不到边界错误。如何解决此错误?