You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**(Don't forget to remove it before deploying to production!)**
25
41
26
-
Alternatively you can also install `@vue/devtools` as project dependency:
42
+
`<your-local-ip>` usually looks like this: `192.168.x.x`.
43
+
44
+
#### Using dependency package
45
+
46
+
Once you installed the package as project dependency, run:
27
47
```bash
28
-
npm install @vue/devtools --save-dev
48
+
./node_modules/.bin/vue-devtools
29
49
```
30
50
31
-
And then directly import it in your app:
51
+
You can also use the global `vue-devtools` to start the app, but you might want to check if the local version matches the global one in this scenario to avoid any incompatibilities.
52
+
53
+
Then import it directly in your app:
32
54
```js
33
55
importdevtoolsfrom'@vue/devtools'
56
+
// import Vue from 'vue'
57
+
```
58
+
> Make sure you import devtools before Vue, otherwise it might not work as expected.
34
59
60
+
And connect to host:
61
+
```js
35
62
if (process.env.NODE_ENV==='development') {
36
-
devtools.connect()
63
+
devtools.connect(/* host */)
37
64
}
38
65
```
39
66
67
+
**host** - is an optional argument that tells your application where devtools middleware server is running, if you debug you app on your computer you don't have to set this (the default is `http://localhost`), but if you want to debug your app on mobile devices, you might want to pass your local IP (e.g. `192.168.1.12`).
0 commit comments