0👍
If you want to use the Composition API, you need to add ‘setup’ to the ‘script’ tag, for example:
<script setup>
import { onMounted } from 'vue'
// lifecycle hooks
onMounted(() => {
console.log('onMounted')
})
</script>
Here is the official documentation.
Additionally, I recommend creating a Vue template using Vite.
- [Vuejs]-Webpack splitchunks creates dynamic chunk file
- [Vuejs]-How to make vueJS hyperlink using method
Source:stackexchange.com