Skip to content

Commit 4beb99f

Browse files
committed
Add a notice about defineModel to some pages
1 parent 132f7ca commit 4beb99f

File tree

6 files changed

+24
-0
lines changed

6 files changed

+24
-0
lines changed

docs/components/checkbox.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ const checkboxValue = ref(true)
1010
</script>
1111
# Checkbox
1212

13+
:::info
14+
This page has not yet been updated to use the `defineModel` macro, which was added in Vue 3.4. The techniques described here should still work, but in some cases it might be better to use `defineModel` instead.
15+
:::
16+
1317
## Checkbox Examples
1418

1519
We're going to look at two examples of a checkbox component. The first example wraps a native `<input>` element to create the checkbox. The second example uses CSS to give the impression of a checkbox without using an `<input>`.

docs/components/radio-group.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ const options = ['First', 'Second', 'Third']
88
</script>
99
# Radio Group
1010

11+
:::info
12+
This page has not yet been updated to use the `defineModel` macro, which was added in Vue 3.4. The techniques described here should still work, but in some cases it might be better to use `defineModel` instead.
13+
:::
14+
1115
## Radio Group Example
1216

1317
A radio group component acts as a wrapper around multiple radio components, with a single `v-model` on the wrapper:

docs/components/radio.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ const options = ['First', 'Second', 'Third']
1111
</script>
1212
# Radio
1313

14+
:::info
15+
This page has not yet been updated to use the `defineModel` macro, which was added in Vue 3.4. The techniques described here should still work, but in some cases it might be better to use `defineModel` instead.
16+
:::
17+
1418
## Radio Examples
1519

1620
We're going to look at two examples of a radio component. The first example wraps a native `<input>` element to create the radio button. The second example uses CSS to give the impression of a radio button without using an `<input>`.

docs/components/tabs.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import TabsExample from './tabs/example.vue'
33
</script>
44
# Tabs
55

6+
:::info
7+
This page has not yet been updated to use the `defineModel` macro, which was added in Vue 3.4. The techniques described here should still work, but in some cases it might be better to use `defineModel` instead.
8+
:::
9+
610
## Tabs Example
711

812
There are various ways to split a tabbed UI up into components. In this example we're going to use two components, an outer container called `tabs` and an inner container for each child called `tab`:

docs/components/toggle-switch.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ const switchValue = ref(true)
66
</script>
77
# Toggle Switch
88

9+
:::info
10+
This page has not yet been updated to use the `defineModel` macro, which was added in Vue 3.4. The techniques described here should still work, but in some cases it might be better to use `defineModel` instead.
11+
:::
12+
913
## Toggle Switch Example
1014

1115
Using a toggle switch should be very similar to using a checkbox:

docs/patterns/computed-v-model.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import ProxyExample from './computed-v-model/proxy-example.vue'
33
</script>
44
# Computed with v-model
55

6+
:::info
7+
This page has not yet been updated to cover the `defineModel` macro, which was added in Vue 3.4. The techniques described here should still work, but in some cases it might be better to use `defineModel` instead.
8+
:::
9+
610
The principle of one-way data flow, with 'props down, events up', is just an extension of the idea that data should only be modified by its owner. This same idea can be extended to other scenarios, such as using Pinia, where the store is considered the owner of the data and so it should only be mutated by the store.
711

812
This causes problems when working with `v-model`, which attempts to modify the value directly. One way we can address this is by using `computed()` with `get` and `set`.

0 commit comments

Comments
 (0)