diff --git a/src/api/compile-time-flags.md b/src/api/compile-time-flags.md index d240e9db41..046f3b9f0a 100644 --- a/src/api/compile-time-flags.md +++ b/src/api/compile-time-flags.md @@ -14,27 +14,27 @@ Vue will work even if these flags are not explicitly configured. However, it is See [Configuration Guides](#configuration-guides) on how to configure them depending on your build tool. -## `__VUE_OPTIONS_API__` +## `__VUE_OPTIONS_API__` {#VUE_OPTIONS_API} - **Default:** `true` Enable / disable Options API support. Disabling this will result in smaller bundles, but may affect compatibility with 3rd party libraries if they rely on Options API. -## `__VUE_PROD_DEVTOOLS__` +## `__VUE_PROD_DEVTOOLS__` {#VUE_PROD_DEVTOOLS} - **Default:** `false` Enable / disable devtools support in production builds. This will result in more code included in the bundle, so it is recommended to only enable this for debugging purposes. -## `__VUE_PROD_HYDRATION_MISMATCH_DETAILS__` +## `__VUE_PROD_HYDRATION_MISMATCH_DETAILS__` {#VUE_PROD_HYDRATATION_MISMATCH_DETAILS} - **Default:** `false` Enable/disable detailed warnings for hydration mismatches in production builds. This will result in more code included in the bundle, so it is recommended to only enable this for debugging purposes. -## Configuration Guides +## Configuration Guides {#configuration-guides} -### Vite +### Vite {#vite} `@vitejs/plugin-vue` automatically provides default values for these flags. To change the default values, use Vite's [`define` config option](https://vitejs.dev/config/shared-options.html#define): @@ -50,7 +50,7 @@ export default defineConfig({ }) ``` -### vue-cli +### vue-cli {#vue-cli} `@vue/cli-service` automatically provides default values for some of these flags. To configure /change the values: @@ -70,7 +70,7 @@ module.exports = { } ``` -### webpack +### webpack {#webpack} Flags should be defined using webpack's [DefinePlugin](https://webpack.js.org/plugins/define-plugin/): @@ -88,7 +88,7 @@ module.exports = { } ``` -### Rollup +### Rollup {#rollup} Flags should be defined using [@rollup/plugin-replace](https://github.com/rollup/plugins/tree/master/packages/replace): diff --git a/src/api/sfc-script-setup.md b/src/api/sfc-script-setup.md index 9cacce0472..ebe1704000 100644 --- a/src/api/sfc-script-setup.md +++ b/src/api/sfc-script-setup.md @@ -253,7 +253,7 @@ function inc() { } ``` -### Modifiers and Transformers +### Modifiers and Transformers {#modifiers-and-transformers} To access modifiers used with the `v-model` directive, we can destructure the return value of `defineModel()` like this: diff --git a/src/guide/components/v-model.md b/src/guide/components/v-model.md index 9fe01e4b70..61b844ed9c 100644 --- a/src/guide/components/v-model.md +++ b/src/guide/components/v-model.md @@ -1,6 +1,6 @@ # Component v-model {#component-v-model} -## Basic Usage +## Basic Usage {#basic-usage} `v-model` can be used on a component to implement a two-way binding. @@ -49,7 +49,7 @@ const model = defineModel() [Playground Example](https://play.vuejs.org/#eNqFUtFKwzAU/ZWYl06YLbK30Q10DFSYigq+5KW0t11mmoQknZPSf/cm3eqEsT0l555zuefmpKV3WsfbBuiUpjY3XDtiwTV6ziSvtTKOLNZcFKQ0qiZRnATkG6JB0BIDJen2kp5iMlfSOlLbisw8P4oeQAhFPpURxVV0zWSa9PNwEgIHtRaZA0SEpOvbeduG5q5LE0Sh2jvZ3tSqADFjFHlGSYJkmhz10zF1FseXvIo3VklcrfX9jOaq1lyAedGOoz1GpyQwnsvQ3fdTqDnTwPhQz9eQf52ob+zO1xh9NWDBbIHRgXOZqcD19PL9GXZ4H0h03whUnyHfwCrReI+97L6RBdo+0gW3j+H9uaw+7HLnQNrDUt6oV3ZBzyhmsjiz+p/dSTwJfUx2+IpD1ic+xz5enwQGXEDJJaw8Gl2I1upMzlc/hEvdOBR6SNKAjqP1J6P/o6XdL11L5h4=) -### Under the Hood +### Under the Hood {#under-the-hood} `defineModel` is a convenience macro. The compiler expands it to the following: diff --git a/src/guide/typescript/overview.md b/src/guide/typescript/overview.md index 8edac4827f..c9377da042 100644 --- a/src/guide/typescript/overview.md +++ b/src/guide/typescript/overview.md @@ -210,7 +210,7 @@ let x: string | number = 1 If using Vue CLI or a webpack-based setup, TypeScript in template expressions requires `vue-loader@^16.8.0`. ::: -### Usage with TSX +### Usage with TSX {#usage-with-tsx} Vue also supports authoring components with JSX / TSX. Details are covered in the [Render Function & JSX](/guide/extras/render-function.html#jsx-tsx) guide.