Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nimawastaken's avatar

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.

0 likes
0 replies

Please or to participate in this conversation.