Mar 16, 2023
0
Level 1
Reactivity does not work on Vue3 after migration!
I'm migrating from vue2 to vue3. I couldn't fix the last problem! after four days! For sake of simplification:
<template>
{{arr}}
</template>
<script>
import { reactive } from 'Vue';
const arri = reactive([1, 2, 3, 4, 5, 6, 7, 8, 9]);
window.setTimeout(() => arri.push(0), 5000);
export default {
name: "w",
computed: {
arr() {
return arri;
}
}
}
</script>
The component does not re-render by any changes to arri (neither timer nor anything else). Same code works on Vue2 except the reactive function or anything else.
Please or to participate in this conversation.