问题七:vue+ts The left-hand side of an assignment expression may not be an optional property?

用ts定义了一个变量,并且用接口做类型定义的,但是赋值的时候就报错???

问题七:vue+ts The left-hand side of an assignment expression may not be an optional property?_第1张图片

解决办法:解决的办法是 赋值之前先判断是否存在

问题七:vue+ts The left-hand side of an assignment expression may not be an optional property?_第2张图片

你可能感兴趣的:(前端,TS,Vue,vue,js,ts)