-2
在此頁面中的示例代碼常量與{}
怪異符號的JavaScript
https://github.com/electron/electron/blob/master/docs/api/net.md
const {app} = require('electron')
定義是什麼{name}
做比較,只是name
?
此外,我試着上面的代碼與jquery和我的錯誤「無法讀取未定義的屬性請求」。
jQuery(document).ready(function($){
const {net} = require('electron');
const request = net.request('https://github.com'); <- here
它解構賦值:https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment – jonrsharpe
的例子使用'app.on(」準備好')',如果你使用它,它會工作嗎? – dayuloli
不......我爲應用程序和網絡添加了console.logs,它們看起來沒有定義..它就像整個腳本無法看到電子。該腳本包含在index.html中使用require('./ renderer.js') – Elfy