美文网首页
ts什么undefined变量在视图中引用报错

ts什么undefined变量在视图中引用报错

作者: 风过留香_3356 | 来源:发表于2022-09-24 11:10 被阅读0次
private a:any = undefined

a不能直接在模板中引用,会报变量没有声明,是因为为undefined的变量没有绑定到data上
解决1 在@comp0nents({data() {
    return {
    }
  }})中什么data,2声明对象 b= {a: undefined}

相关文章

网友评论

      本文标题:ts什么undefined变量在视图中引用报错

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