我是靠谱客的博主 孝顺外套,这篇文章主要介绍Type ‘string‘ is not assignable to type ‘“xx1“ | “xx2“ | undefined,现在分享给大家,希望可以做个参考。

新手常遇typescript类型约束报错,是宽泛的字符串约束和具体值的类型约束的问题,使用as const 解决。原理详细如下
https://blog.csdn.net/weixin_43263355/article/details/120943605

最后

以上就是孝顺外套最近收集整理的关于Type ‘string‘ is not assignable to type ‘“xx1“ | “xx2“ | undefined的全部内容,更多相关Type内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(61)

评论列表共有 0 条评论

立即
投稿
返回
顶部