0👍
For component code style, vue 3 recommend to use defineComponent
+ composition api
+ template(or tsx)
<template>
<p class="msg">{{ msg }}</p>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
setup () {
const msg = 'Hello World!';
return {
msg
}
}
})
</script>
<style scoped lang="scss" >
</style>
Source:stackexchange.com