diff --git a/src/api/sfc-script-setup.md b/src/api/sfc-script-setup.md index 3f6c6405cd..33649b7d3d 100644 --- a/src/api/sfc-script-setup.md +++ b/src/api/sfc-script-setup.md @@ -314,6 +314,7 @@ const myRef = ref() ``` +Also, when using `withDefaults` with `defineProps`, default values for mutable reference types (like arrays or objects) should be wrapped in functions in `defineModel` to avoid accidental modification and external side effects. ::: ### Modifiers and Transformers {#modifiers-and-transformers} diff --git a/src/guide/components/v-model.md b/src/guide/components/v-model.md index e1248c18f5..c6f7ebb085 100644 --- a/src/guide/components/v-model.md +++ b/src/guide/components/v-model.md @@ -115,6 +115,7 @@ const myRef = ref() ``` +Also, when using `withDefaults` with `defineProps`, default values for mutable reference types (like arrays or objects) should be wrapped in functions in `defineModel` to avoid accidental modification and external side effects. :::