Skip to content

Commit 8ff23c7

Browse files
yyx990803NataliaTepluhinaafontcuposva
authored
Apply suggestions from code review
Co-authored-by: Natalia Tepluhina <tarya.se@gmail.com> Co-authored-by: Adrià Fontcuberta <afontcu@gmail.com> Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
1 parent 373d3cd commit 8ff23c7

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

src/api/computed-watch-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Alias of `watchEffect` with `flush: 'sync'` option.
9494

9595
## `watch`
9696

97-
The `watch` API is the exact equivalent of the Options API [this.\$watch](./instance-methods.html#watch) (and the corresponding [watch](./options-data.html#watch) option). `watch` requires watching a specific data source and applies side effects in a separate callback function. It also is lazy by default - i.e. the callback is only called when the watched source has changed.
97+
The `watch` API is the exact equivalent of the Options API [this.$watch](./instance-methods.html#watch) (and the corresponding [watch](./options-data.html#watch) option). `watch` requires watching a specific data source and applies side effects in a separate callback function. It also is lazy by default - i.e. the callback is only called when the watched source has changed.
9898

9999
- Compared to [watchEffect](#watcheffect), `watch` allows us to:
100100

src/api/directives.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@
494494
</div>
495495
```
496496

497-
When the component's `selected` state changes, a large amount of vnodes will be created even though most of the items remained exactly the same. The `v-memo` usage here is essentially saying "only update this item if it went from non-selected to selected, or the other way around". This allows every unaffected item to reuse its previous vnode and skip diffing entirely. Note we don't need to include `item.id` in the memo dependency array here since Vue automatically infers it from the item's `:key`.
497+
When the component's `selected` state changes, a large amount of VNodes will be created even though most of the items remained exactly the same. The `v-memo` usage here is essentially saying "only update this item if it went from non-selected to selected, or the other way around". This allows every unaffected item to reuse its previous VNode and skip diffing entirely. Note we don't need to include `item.id` in the memo dependency array here since Vue automatically infers it from the item's `:key`.
498498

499499
`v-memo` can also be used on components to manually prevent unwanted updates in certain edge cases where the child component update check has been de-optimized. But again, it is the developer's responsibility to specify correct dependency arrays to avoid skipping necessary updates.
500500

src/api/sfc-script-setup.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebarDepth: 1
44

55
# SFC `<script setup>`
66

7-
`<script setup>` is a compile-time syntacitc sugar for using [Composition API](https://v3.vuejs.org/api/composition-api.html) inside Single File Components (SFCs). It is the recommended syntax if you are using both SFCs and Composition API. It provides a number of advantages over the normal `<script>` syntax:
7+
`<script setup>` is a compile-time syntactic sugar for using [Composition API](https://v3.vuejs.org/api/composition-api.html) inside Single File Components (SFCs). It is the recommended syntax if you are using both SFCs and Composition API. It provides a number of advantages over the normal `<script>` syntax:
88

99
- More succinct code with less boilerplate
1010
- Ability to declare props and emitted events using pure TypeScript
@@ -85,7 +85,7 @@ Values in the scope of `<script setup>` can also be used directly as custom comp
8585
</template>
8686
```
8787

88-
Think of `MyComponent` as being referenced as a varaible. If you have used JSX before, the mental model is similar here. The kebab-case equivalent `<my-component>` also works in the template - however PascalCase component tags are strongly recommended for consistency. It also helps differentiating from native custom elements.
88+
Think of `MyComponent` as being referenced as a variable. If you have used JSX before, the mental model is similar here. The kebab-case equivalent `<my-component>` also works in the template - however PascalCase component tags are strongly recommended for consistency. It also helps differentiating from native custom elements.
8989

9090
### Dynamic Components
9191

@@ -179,8 +179,8 @@ Usage of `slots` and `attrs` inside `<script setup>` should be relatively rare,
179179

180180
`<script setup>` can be used alongside normal `<script>`. A normal `<script>` maybe needed in cases where we need to:
181181

182-
- Declare options that cannot be expressed in `<script setup>`, for example `inheritAttrs` or custom options enabled via plugins;
183-
- Declaring named exports;
182+
- Declare options that cannot be expressed in `<script setup>`, for example `inheritAttrs` or custom options enabled via plugins.
183+
- Declaring named exports.
184184
- Run side effects or create objects that should only execute once.
185185

186186
```html

src/api/sfc-spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default {
4040

4141
### `<script>`
4242

43-
- Each `*.vue` file can contain at most one `<script>` block at a time (excluding `<script setup>`).
43+
- Each `*.vue` file can contain at most one `<script>` block at a time (excluding [<script setup>](/api/sfc-script-setup.html)).
4444

4545
- The script is executed as an ES Module.
4646

src/api/sfc-style.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ With `scoped`, the parent component's styles will not leak into child components
4040

4141
### Deep Selectors
4242

43-
If you want a selector in `scoped` styles to be "deep", i.e. affecting child components, you can use the `:deep()` psuedo-class:
43+
If you want a selector in `scoped` styles to be "deep", i.e. affecting child components, you can use the `:deep()` pseudo-class:
4444

4545
```vue
4646
<style scoped>
@@ -76,7 +76,7 @@ By default, scoped styles do not affect contents rendered by `<slot/>`, as they
7676

7777
### Global Selectors
7878

79-
If you want just one rule to apply globally, you can use the `:global` pseudo-class:
79+
If you want just one rule to apply globally, you can use the `:global` pseudo-class rather than creating another `<style>` (see below):
8080

8181
```vue
8282
<style scoped>

src/api/sfc-tooling.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ You don't need to install anything on your machine to try out Vue SFCs - there a
99
- [Vue on CodeSandbox](https://codesandbox.io/s/vue-3)
1010
- [Vue on Repl.it](https://replit.com/@templates/VueJS-with-Vite)
1111
- [Vue on Codepen](https://codepen.io/pen/editor/vue)
12-
- [Vue on StackBlitz](stackblitz.com/fork/vue)
12+
- [Vue on StackBlitz](https://stackblitz.com/fork/vue)
1313

14-
It is also recommend to use these online playgrounds to provide reproductions when reporting bugs.
14+
It is also recommended to use these online playgrounds to provide reproductions when reporting bugs.
1515

1616
## Project Scaffolding
1717

@@ -61,7 +61,7 @@ Most other editors have community-created syntax highlighting support for Vue, b
6161

6262
- Vue CLI comes with [Jest](https://jestjs.io/) and [Mocha](https://mochajs.org/) integrations.
6363

64-
- If you are manually confugring Jest to work with Vue SFCs, check out [vue-jest](https://github.com/vuejs/vue-jest) which is the official Jest transform for Vue SFCs.
64+
- If you are manually configuring Jest to work with Vue SFCs, check out [vue-jest](https://github.com/vuejs/vue-jest) which is the official Jest transform for Vue SFCs.
6565

6666
## Custom Blocks Integration
6767

@@ -91,4 +91,4 @@ Official plugin that provides Vue SFC support in Vite.
9191

9292
- [Docs](https://vue-loader.vuejs.org/)
9393

94-
The official loader that provides Vue SFC support in webpack. If you are using Vue CLI, also see [docs on modifying `vue-loader` options in Vue CLI](https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader).
94+
The official loader that provides Vue SFC support in webpack. If you are using Vue CLI, also see [docs on modifying `vue-loader` options in Vue CLI](https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader).

0 commit comments

Comments
 (0)