【发布时间】:2020-09-10 20:16:57
【问题描述】:
根据旧函数 rfc,Vue3 将仅支持 typescript props -typing:https://github.com/vuejs/rfcs/blob/function-apis/active-rfcs/0000-function-api.md#typescript-only-props-typing
当我尝试遵循代码时,它似乎不起作用。道具将是未定义的。
interface MessageProps {
msg: string;
list: any[];
}
export default defineComponent({
name: 'HelloWorld',
setup(props: MessageProps) {
console.log(props)
}
})
【问题讨论】:
标签: javascript typescript vue.js vue-component vuejs3