private a:any = undefined
a不能直接在模板中引用,会报变量没有声明,是因为为undefined的变量没有绑定到data上
解决1 在@comp0nents({data() {
return {
}
}})中什么data,2声明对象 b= {a: undefined}
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
网友评论