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

使用vue-demi导出ref的对象,会使响应式失效 #496

Open
guccihuiyuan opened this issue Sep 14, 2023 · 1 comment
Open

使用vue-demi导出ref的对象,会使响应式失效 #496

guccihuiyuan opened this issue Sep 14, 2023 · 1 comment

Comments

@guccihuiyuan
Copy link

guccihuiyuan commented Sep 14, 2023

一、Remote端(简写):

import { ref } from 'vue-demi'
const dataSource = ref<any[]>([])

onMounted(() => {
  dataSource.value = [1, 2, 3]
})

二、Host端(简写)

watch(() => dataSource.value, () => {
  console.log(dataSource.value)
})

remote端打包以后,在host端使用 dataSource变量,但是这个变量的响应式失效了,不能监听、不能更新UI,这是什么原因造成的呢?或者有什么解决方案呢?

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: Using vue-demi to export ref objects will invalidate the responsiveness

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

No branches or pull requests

2 participants