HarmonyOS NEXT创建对象提示Object literal must correspond to some explicitly declared class or interface
let userinfo={
username:"张三",
age:20,
sex:"男"
}
解决办法:
interface UserInfoInterface{
username:string,
age:number,
sex:string
}
let userinfo:UserInfoInterface={
username:"张三",
age:20,
sex:"男"
}