any86 / vue-error

常见vue3报错解决
2 stars 0 forks source link

'xxx' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.Vetur(7023) #1

Open any86 opened 2 years ago

any86 commented 2 years ago
props:{
  yyy:{
    type:String,
  }
},  
computed: {
  xxx() {
    return this.yyy
  },
},

解决办法

给xxx计算属性标记返回值类型.

computed: {
  xxx():string {
    return this.yyy
  },
},