0

Is there any reason why these 2 v-model bindings below would behave differently?

// component that uses FormExample
<script setup>
const fullName = someObject.fullName
</script>
<template>
 // this works
 <InputText v-model="fullName"/>
 // this does not work
 <InputText v-model="someObject.fullName"/>
</template>
asked May 23, 2024 at 14:26
1
  • 1
    The example is not runnable. how is someObject defined? what is the InputText component? whatever is assigned to v-model should be defined as reactive... Try making your minimal example using https://play.vuejs.org/ Commented May 23, 2024 at 14:56

1 Answer 1

0

Found a solution.

Issue is that the setup function doesn't unwrap refs recursively.

Therefore, you need to do it yourself.

<InputText v-model="someObject.fullName.value"/>
answered May 23, 2024 at 16:15
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.