How to get the value of props in the component of vue3
For the following components, I want to infer the types of props and data through the generic parameter passing of defineComponent, but the value of props cannot be obtained by doing so. How can I modify it?
import { defineComponent , Prop, Ref, toRefs} from 'vue'
interface MProps {
day: number
}
interface MData {
day: Ref<number>,
}
export default defineComponent<MProps, MData>({
setup(props, content) {
const { day } = toRefs(props)
console.log('props.day', props.day)
return {
day: day,
}
},
render() {
return <div>
{this.day}
</div>
}
})