Skip to content

Commit

Permalink
Move component v-model to its own page (#2153)
Browse files Browse the repository at this point in the history
  • Loading branch information
skirtles-code authored and Abdelaziz18003 committed Jan 11, 2023
1 parent 696c36a commit b9a3cc3
Show file tree
Hide file tree
Showing 6 changed files with 459 additions and 438 deletions.
1 change: 1 addition & 0 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export const sidebar: ThemeConfig['sidebar'] = {
},
{ text: 'الخاصيات', link: '/guide/components/props' },
{ text: 'الأحداث', link: '/guide/components/events' },
{ text: 'Component v-model', link: '/guide/components/v-model' },
{
text: 'السمات الإحتياطية',
link: '/guide/components/attrs'
Expand Down
2 changes: 1 addition & 1 deletion src/api/built-in-directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ Create a two-way binding on a form input element or a component.
- **See also:**

- [Form Input Bindings](/guide/essentials/forms.html)
- [Component Events - Usage with `v-model`](/guide/components/events.html#usage-with-v-model)
- [Component Events - Usage with `v-model`](/guide/components/v-model.html)

## v-slot {#v-slot}

Expand Down
2 changes: 1 addition & 1 deletion src/api/reactivity-utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Can be used to create a ref for a property on a source reactive object. The crea
</script>
```
When `toRef` is used with component props, the usual restrictions around mutating the props still apply. Attempting to assign a new value to the ref is equivalent to trying to modify the prop directly and is not allowed. In that scenario you may want to consider using [`computed`](./reactivity-core.html#computed) with `get` and `set` instead. See the guide to [using `v-model` with components](/guide/components/events.html#usage-with-v-model) for more information.
When `toRef` is used with component props, the usual restrictions around mutating the props still apply. Attempting to assign a new value to the ref is equivalent to trying to modify the prop directly and is not allowed. In that scenario you may want to consider using [`computed`](./reactivity-core.html#computed) with `get` and `set` instead. See the guide to [using `v-model` with components](/guide/components/v-model.html) for more information.
`toRef()` will return a usable ref even if the source property doesn't currently exist. This makes it possible to work with optional properties, which wouldn't be picked up by [`toRefs`](#torefs).
Expand Down
Loading

0 comments on commit b9a3cc3

Please sign in to comment.