From b64c94b58335066297672129e051fd226aa5b925 Mon Sep 17 00:00:00 2001 From: Fatpandac Date: Tue, 4 Apr 2023 18:35:34 +0800 Subject: [PATCH] update api/index.md, add more tips for productionTip and devtools option --- src/v2/api/index.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 2e073bbcb6..f7f7fff1b4 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -58,6 +58,11 @@ type: api ``` js // make sure to set this synchronously immediately after loading Vue Vue.config.devtools = true + + // Suggest using the `onload` attribute of the script tag to run the above code + // if run on Chrome or other browsers engine based on Blink, + // like the following: + ``` 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 - **Type:** `boolean` -- **Default:** `true` +- **Default:** `true` (`false` in production builds) - **Usage**: + ``` js + // make sure to set this synchronously immediately after loading Vue + Vue.config.productionTip = true + + // Suggest using the `onload` attribute of the script tag to run the above code + // if run on Chrome or other browsers engine based on Blink, + // like the following: + + ``` Set this to `false` to prevent the production tip on Vue startup. ## Global API