美文网首页
vue + typescript:Property 'xxx'

vue + typescript:Property 'xxx'

作者: 头发飘逸 | 来源:发表于2020-10-22 17:42 被阅读0次

代码为:

this.$parent.paymentType();

这是子组件调用父组件的方法,用了ts之后就开始报错。但功能是OK的,那肯定就是ts的问题了,后面想了想试试改成any就不报错

(this as any).$parent.paymentType();

相关文章

网友评论

      本文标题:vue + typescript:Property 'xxx'

      本文链接:https://www.haomeiwen.com/subject/kddpmktx.html