Skip to content

Commit b64c94b

Browse files
committed
update api/index.md, add more tips for productionTip and devtools option
1 parent c0529f1 commit b64c94b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/v2/api/index.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ type: api
5858
``` js
5959
// make sure to set this synchronously immediately after loading Vue
6060
Vue.config.devtools = true
61+
62+
// Suggest using the `onload` attribute of the script tag to run the above code
63+
// if run on Chrome or other browsers engine based on Blink,
64+
// like the following:
65+
<script src="path/to/vue.js" onload="Vue.config.devtools = true"></script>
6166
```
6267

6368
Configure whether to allow [vue-devtools](https://github.com/vuejs/vue-devtools) inspection. This option's default value is `true` in development builds and `false` in production builds. You can set it to `true` to enable inspection for production builds.
@@ -170,10 +175,19 @@ type: api
170175
171176
- **Type:** `boolean`
172177

173-
- **Default:** `true`
178+
- **Default:** `true` (`false` in production builds)
174179

175180
- **Usage**:
176181

182+
``` js
183+
// make sure to set this synchronously immediately after loading Vue
184+
Vue.config.productionTip = true
185+
186+
// Suggest using the `onload` attribute of the script tag to run the above code
187+
// if run on Chrome or other browsers engine based on Blink,
188+
// like the following:
189+
<script src="path/to/vue.js" onload="Vue.config.productionTip = true"></script>
190+
```
177191
Set this to `false` to prevent the production tip on Vue startup.
178192

179193
## Global API

0 commit comments

Comments
 (0)