2017-07-23 31 views
0

通常当我使用frame: false,在像Windows这样的平台上,它隐藏窗口顶部的框架以及按钮。我非常喜欢这个功能,我想用我的Raspberry Pi运行raspbian。电子框架:假不工作树莓派3模型B

我已将NPM更新为最新版本。我也试过--enable-transparent-visuals --disable-gpu,但它似乎没有工作。总之,这里是我目前main.js:

const {app, BrowserWindow} = require('electron'); 
const path = require('path'); 
const url = require('url'); 

let win; 

function createWindow() { 

    win = new BrowserWindow({width: 800, height: 600}); 


    win.loadURL(url.format({ 
    pathname: path.join(__dirname, 'index.html'), 
    protocol: 'file:', 
    slashes: true, 
    frame: false 
    })); 


    win.webContents.openDevTools(); 

    win.on('closed',() => { 

    win = null; 
    }) 
} 


app.on('ready', createWindow); 


app.on('window-all-closed',() => { 

    if (process.platform !== 'darwin') { 
    app.quit(); 
    } 
}); 

app.on('activate',() => { 

    if (win === null) { 
    createWindow(); 
    } 

这里是我的package.js:

{ 
    "name": "myApp", 
    "version": "1.0.0", 
    "description": "", 
    "main": "main.js", 
    "scripts": { 
    "start": "electron ." 
    }, 
    "author": "", 
    "license": "ISC", 
    "devDependencies": { 
    "electron": "^1.6.11" 
    } 
} 

回答

0

发现错误,它是一个错字。帧:false应该显然在窗口的初始化中。