HarmonyOS NEXT创建对象提示Object literal must correspond to some explicitly declared class or interface
HarmonyOS NEXT创建对象提示Object literal must correspond to some explicitly declared class or interface
参考HarmonyOS NEXT系列教程: https://www.itying.com/category-93-b0.html
let userinfo={
username:"张三",
age:20,
sex:"男"
}
解决办法
interface UserInfoInterface{
username:string,
age:number,
sex:string
}
let userinfo:UserInfoInterface={
username:"张三",
age:20,
sex:"男"
}