Skip to content

Commit 524de31

Browse files
authored
docs: make v-model code example more readable (#3069)
1 parent 4e94b68 commit 524de31

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/guide/components/v-model.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,15 @@ const model = defineModel({ default: 0 })
9999
:::warning
100100
If you have a `default` value for `defineModel` prop and you don't provide any value for this prop from the parent component, it can cause a de-synchronization between parent and child components. In the example below, the parent's `myRef` is undefined, but the child's `model` is 1:
101101

102+
**Child component:**
103+
102104
```js
103-
// child component:
104105
const model = defineModel({ default: 1 })
106+
```
105107

106-
// parent component:
108+
**Parent component:**
109+
110+
```js
107111
const myRef = ref()
108112
```
109113

0 commit comments

Comments
 (0)