<script lang="ts">
import Vue from "vue"
import HelloWorld from "@/components/HelloWorld.vue"
export default Vue.extend({
components: { HelloWorld },
data () {
return {
bb: "123"
}
},
watch: {
bb (val: String) {
console.log(val)
}
},
props: {
propA: Number
},
methods: {
haha (a: String) {
console.log(a)
}
},
created () {
}
})
</script>
at present, everything except data works normally, but there is no clue as to how the content in data declares the type. The official document seems to only give the writing method of "class-based Vue component". However, in order to maintain the consistency with the old project, we do not want to use this method at present.