This theme is from |

guangzan

园龄:6年5个月粉丝:676关注:333

2019-11-12 21:10阅读: 2524评论: 0推荐: 0

vue3 createComponent

  • 这个函数不是必须的,除非你想要完美结合 TypeScript 提供的类型推断来进行项目的开发。
  • 这个函数仅仅提供了类型推断,方便在结合 TypeScript 书写代码时,能为 setup() 中的 props 提供完整的类型推断。
import { createComponent } from 'vue'

export default createComponent({
 props: {
   foo: String
 },
 setup(props) {
   props.foo // <- type: string
 }
})

本文作者:guangzan

本文链接:https://www.cnblogs.com/guangzan/p/11845241.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   guangzan  阅读(2524)  评论(0编辑  收藏  举报
评论
收藏
关注
推荐
深色
回顶
收起
点击右上角即可分享
微信分享提示