• 赚钱入口【需求资源】限时招募流量主、渠道主,站长合作;【合作模式】CPS长期分成,一次推广永久有收益。主动打款,不扣量;

VueJS + TypeScript报错:Unable to resolve signature of class decorator when called as an expression.

Vue cps12345 1年前 (2020-07-18) 1031次浏览 0个评论

错误:

ERROR in /Users/JohnSmith/test/src/components/HelloWorld.vue
37:1 Unable to resolve signature of class decorator when called as an expression.
  Type '<VC extends VueClass<Vue>>(target: VC) => VC' is missing the following properties from type 'typeof HelloWorld': extend, nextTick, set, delete, and 7 more.
    35 | import { Component, Prop, Vue } from 'vue-property-decorator';
    36 | 
  > 37 | @Component
       | ^
    38 | export default class HelloWorld extends Vue {
    39 |   @Prop() private msg!: string;
    40 | }

解决方法:

@Component({
  props: {
    msg: {type: String},
  },
})
export default class HelloWorld extends Vue {
  // @Prop() private msg!: string;}
喜欢 (9)

您必须 登录 才能发表评论!