Using vue3 and vite2
Below is a simple code snippet.
The expected behavior is that when the button is clicked, the reactive 'msg' variable should change.
It works as expected in development using Vite, but after building for production (Vite build) and deploying, it seems to stop working. The click method cannot access the reactive 'msg' variable.
According to the VueJS documentation, the options API can work alongside the composition API.
<template>
<h1>{{ msg }}</h1>
<button @click="click">Click</button>
</template>
<script setup>
const msg = ref('hello')
</script>
<script>
import { ref } from 'vue'
export default {
methods: {
click() {
this.msg = 'ok'
},
},
}
</script>