原属性声明@Prop(String) id:string编译会出错
解决方法:直接给id后面加一个?或者!
改为@Prop(String) id?:string 或者@Prop(String) id!:string
前者是指我们不确定是否会传入这个参数,后者是指我们一定会给这个参数赋值
更多推荐
Property ‘id‘ has no initializer and is not definitely assigned in the construct
原属性声明@Prop(String) id:string编译会出错
解决方法:直接给id后面加一个?或者!
改为@Prop(String) id?:string 或者@Prop(String) id!:string
前者是指我们不确定是否会传入这个参数,后者是指我们一定会给这个参数赋值
更多推荐
Property ‘id‘ has no initializer and is not definitely assigned in the construct
发布评论