使用vue-demi导出ref的对象,会使响应式失效
guccihuiyuan opened this issue · 2 comments
guccihuiyuan commented
一、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 commented
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