Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move component v-model to its own page #2153

Merged
merged 1 commit into from
Jan 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export const sidebar: ThemeConfig['sidebar'] = {
},
{ text: 'Props', link: '/guide/components/props' },
{ text: 'Events', link: '/guide/components/events' },
{ text: 'Component v-model', link: '/guide/components/v-model' },
{
text: 'Fallthrough Attributes',
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