2017-07-23 30 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應該顯然在窗口的初始化中。