docs: Update codes in docs to use require('electron')

This commit is contained in:
Cheng Zhao 2015-11-12 21:20:09 +08:00
parent 8b2942c279
commit eac2e7cc61
32 changed files with 134 additions and 157 deletions

View file

@ -8,7 +8,7 @@ An example of showing a dialog to select multiple files and directories:
```javascript
var win = ...; // BrowserWindow in which to show the dialog
var dialog = require('dialog');
const dialog = require('electron').dialog;
console.log(dialog.showOpenDialog({ properties: [ 'openFile', 'openDirectory', 'multiSelections' ]}));
```
@ -114,6 +114,6 @@ will be passed via `callback(response)`.
Displays a modal dialog that shows an error message.
This API can be called safely before the `ready` event the `app` module emits,
it is usually used to report errors in early stage of startup. If called
before the app `ready`event on Linux, the message will be emitted to stderr,
it is usually used to report errors in early stage of startup. If called
before the app `ready`event on Linux, the message will be emitted to stderr,
and no GUI dialog will appear.