Open ryanuo opened 7 months ago
Hi @rr210,
Please can you please provide a reproduction for us to help you.
When trying the following simple setup it seems to work;
<template>
<div>
<UTextarea v-model="value.value" />
<UInput v-model="value.value" />
<UButton @click="addone">Change</UButton>
{{ value }}
</div>
</template>
<script setup>
function addone() {
value.value.value += '!'
}
const value = ref({
value: 'Hello'
})
</script>
Hi @rr210,
Please can you please provide a reproduction for us to help you.
When trying the following simple setup it seems to work;
<template> <div> <UTextarea v-model="value.value" /> <UInput v-model="value.value" /> <UButton @click="addone">Change</UButton> {{ value }} </div> </template> <script setup> function addone() { value.value.value += '!' } const value = ref({ value: 'Hello' }) </script>
I was using pinia to persist the data and the response was different, it felt like utextarea was trying not to update
Can you provide a reproduction so we can try help? You can use a template from nuxt.new
Can you provide a reproduction so we can try help? You can use a template from nuxt.new您能否提供复制品以便我们尝试提供帮助?您可以使用 nuxt.new 中的模板
https://github.com/rr210/own-cover/tree/dev-test branch dev-test
code in components\CoverConfig.vue:77
After modifying the title text on the page and refreshing the page, you will find two different ones
Hi @rr210,
In that branch there is no UInput above the UTextarea - when i do add one it works fine...
https://github.com/nuxt/ui/assets/82201261/424db49c-ff9c-4b88-9b90-8cb9d108ade4
Hi @rr210, 你好 ,
In that branch there is no UInput above the UTextarea - when i do add one it works fine...在该分支中,UTextarea 上方没有 UInput - 当我添加一个时,它工作正常......
Screen.Recording.2024-04-21.at.21.01.02.mov
Is it the dev-test branch? I added a ref in the component in the master branch code, and it worked. You can try the dev-test branch; this can be reproduced.
Yes
Yes
Is the video you mentioned above showcasing the dev-test branch?.....It's strange then.
@rr210 This link doesn't work
Environment
Version
npm:@nuxt/ui-edge@latest
Reproduction
Description
Problem: When using UTextarea component in conjunction with pinia and v-model, there is an inconsistency in behavior compared to using UInput.
Expected Behavior: Both UInput and UTextarea should behave consistently when used with pinia and v-model. Updates to the bound data should reflect immediately in both components.
Actual Behavior:
When updating the data bound to UInput using v-model, the changes are reflected immediately in the UI. However, when updating the data bound to UTextarea using v-model, the changes are not reflected immediately.
Additional context
Logs
No response