Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[t-input] 绑定数据A,然后异步改变了A的数据,但是视图没有更新数据 #1618

Open
Jason7Le opened this issue Oct 12, 2024 · 2 comments

Comments

@Jason7Le
Copy link

tdesign-mobile-vue 版本

1.4.3

重现链接

No response

重现步骤

[t-input] 绑定数据A,然后异步改变了A的数据,但是视图没有更新数据

期望结果

希望其他地方改变了数据,input绑定的视图也更新;

实际结果

No response

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

20.13.0

补充说明

No response

Copy link
Contributor

👋 @Jason7Le,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@anlyyao
Copy link
Collaborator

anlyyao commented Oct 14, 2024

@Jason7Le 方便贴一下你实际使用代码吗? 我用setTimeout变更value,视图可以响应更新
https://stackblitz.com/edit/de8ewn?file=src%2Fdemo.vue

<template>
  <t-input v-model:value="value" label="标签文字" placeholder="请输入文字"></t-input>

  <t-input v-model="value" label="标签文字" placeholder="请输入文字"></t-input>

  <t-input :value="value" label="标签文字" placeholder="请输入文字"></t-input>
</template>

<script lang="ts" setup>
import { ref, onMounted } from 'vue';

const value = ref('123');

onMounted(() => {
  setTimeout(() => {
    value.value = '456';
  }, 3000);
});
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants