originjs / vite-plugin-federation

Module Federation for vite & rollup
Other
2.32k stars 239 forks source link

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

Open guccihuiyuan opened 1 year ago

guccihuiyuan commented 1 year ago

一、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 1 year ago

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