下面这 2 个 v-model 绑定是否有不同的行为?
// 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>
找到解决方案。
问题是设置函数不会递归地解开引用。
因此,你需要自己做。
<InputText v-model="someObject.fullName.value"/>