Skip to content

Commit 24812e5

Browse files
authored
Merge pull request #486 from Akryum/2017-winter-holidays
🎄 2017 Winter Holidays update
2 parents e08231e + 6597aa6 commit 24812e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2263
-1273
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"globals": {
1010
"bridge": true,
1111
"chrome": true,
12-
"localStorage": true
12+
"localStorage": true,
13+
"HTMLDocument": true
1314
}
1415
}

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ Works with [vuex](https://github.com/vuejs/vuex) for time-travel debugging:
2020

2121
- [Workaround for Safari](https://github.com/vuejs/vue-devtools/blob/master/docs/workaround-for-safari.md)
2222

23+
#### Open component in editor
24+
25+
To enable this feature, follow [this guide](./docs/open-in-editor.md).
26+
2327
### Manual Installation
2428

2529
**Make sure you are using Node 6+ and NPM 3+**
@@ -66,7 +70,7 @@ Works with [vuex](https://github.com/vuejs/vuex) for time-travel debugging:
6670
~~~~
6771

6872
When using Yarn, just replace `npm` with `yarn`.
69-
73+
7074

7175
### Commom problems and how to fix
7276

docs/open-in-editor.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Open component in editor
2+
3+
## Nuxt.js
4+
5+
Nuxt supports this feature out-of-the-box. Make sure to be in debug mode.
6+
7+
## Webpack
8+
9+
In your Vue project, install the [launch-editor-middleware](https://github.com/yyx990803/launch-editor#middleware) package and modifiy your webpack configuration:
10+
11+
1. Import the package:
12+
13+
```js
14+
var openInEditor = require('launch-editor-middleware')
15+
```
16+
17+
2. In the `devServer` option, register the `/__open-in-editor` HTTP route:
18+
19+
```js
20+
devServer: {
21+
before (app) {
22+
app.use('/__open-in-editor', openInEditor())
23+
}
24+
}
25+
```
26+
27+
3. The editor to launch is guessed. You can also specify the editor app with the `editor` option. See the [supported editors list](https://github.com/yyx990803/launch-editor#supported-editors).
28+
29+
```js
30+
openInEditor({
31+
editor: 'code'
32+
})
33+
```
34+
35+
4. You can now click on the name of the component in the Component inspector pane (if the devtools knows about its file source, a tooltip will appear).
36+
37+
## Node.js
38+
39+
You can use the [launch-editor](https://github.com/yyx990803/launch-editor#usage) package to setup an HTTP route with the `/__open-in-editor` path. It will receive `file` as an URL variable.

0 commit comments

Comments
 (0)