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
Remove excess words and fix minor language issues (#2266)
* Remove excess words and fix minor language issues
Remove "at a time" which is redundant as "at most" is sufficient
Replace "relevant tooling section" with the name of the section for better accessibility
Make "Src" lowercase to be consistent with other use of tags and attributes in the Vue documentation, i.e. setup() and <script setup>
* Wrap src in backticks
Following your suggestion, I checked more of the docs and I agree that it should be wrapped in backticks here too.
Co-authored-by: skirtle <65301168+skirtles-code@users.noreply.github.com>
---------
Co-authored-by: skirtle <65301168+skirtles-code@users.noreply.github.com>
Copy file name to clipboardExpand all lines: src/api/sfc-spec.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -36,21 +36,21 @@ export default {
36
36
37
37
### `<template>` {#template}
38
38
39
-
- Each `*.vue` file can contain at most one top-level `<template>` block at a time.
39
+
- Each `*.vue` file can contain at most one top-level `<template>` block.
40
40
41
41
- Contents will be extracted and passed on to `@vue/compiler-dom`, pre-compiled into JavaScript render functions, and attached to the exported component as its `render` option.
42
42
43
43
### `<script>` {#script}
44
44
45
-
- Each `*.vue` file can contain at most one `<script>` block at a time (excluding [`<script setup>`](/api/sfc-script-setup)).
45
+
- Each `*.vue` file can contain at most one `<script>` block (excluding [`<script setup>`](/api/sfc-script-setup)).
46
46
47
47
- The script is executed as an ES Module.
48
48
49
49
- The **default export** should be a Vue component options object, either as a plain object or as the return value of [defineComponent](/api/general#definecomponent).
50
50
51
51
### `<script setup>` {#script-setup}
52
52
53
-
- Each `*.vue` file can contain at most one `<script setup>` block at a time (excluding normal `<script>`).
53
+
- Each `*.vue` file can contain at most one `<script setup>` block (excluding normal `<script>`).
54
54
55
55
- The script is pre-processed and used as the component's `setup()` function, which means it will be executed **for each instance of the component**. Top-level bindings in `<script setup>` are automatically exposed to the template. For more details, see [dedicated documentation on `<script setup>`](/api/sfc-script-setup).
56
56
@@ -68,15 +68,15 @@ Additional custom blocks can be included in a `*.vue` file for any project-speci
Handling of Custom Blocks will depend on tooling - if you want to build your own custom block integrations, see [relevant tooling section](/guide/scaling-up/tooling#sfc-custom-block-integrations) for more details.
71
+
Handling of Custom Blocks will depend on tooling - if you want to build your own custom block integrations, see the [SFC custom block integrations tooling section](/guide/scaling-up/tooling#sfc-custom-block-integrations) for more details.
72
72
73
73
## Automatic Name Inference {#automatic-name-inference}
74
74
75
75
An SFC automatically infers the component's name from its **filename** in the following cases:
76
76
77
77
- Dev warning formatting
78
78
- DevTools inspection
79
-
- Recursive self-reference. E.g. a file named `FooBar.vue` can refer to itself as `<FooBar/>` in its template. This has lower priority than explicitly registered/imported components.
79
+
- Recursive self-reference, e.g. a file named `FooBar.vue` can refer to itself as `<FooBar/>` in its template. This has lower priority than explicitly registered/imported components.
80
80
81
81
## Pre-Processors {#pre-processors}
82
82
@@ -109,7 +109,7 @@ Note that integration with various pre-processors may differ by toolchain. Check
If you prefer splitting up your `*.vue` components into multiple files, you can use the `src` attribute to import an external file for a language block:
0 commit comments