From b9387260bc8ebc2d6d29793a9c29f8dde410dbe2 Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Wed, 16 Oct 2024 14:54:18 +0200 Subject: [PATCH] Make code example more readable --- src/guide/components/v-model.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/guide/components/v-model.md b/src/guide/components/v-model.md index 57bb9f260a..fcff6554cd 100644 --- a/src/guide/components/v-model.md +++ b/src/guide/components/v-model.md @@ -99,11 +99,15 @@ const model = defineModel({ default: 0 }) :::warning 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: +**Child component:** + ```js -// child component: const model = defineModel({ default: 1 }) +``` -// parent component: +**Parent component:** + +```js const myRef = ref() ```