当前位置: 代码网 > it编程>硬件开发>arm开发 > 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

2024年08月03日 arm开发 我要评论
HarmonyOS NEXT创建对象提示Object literal must correspond to some explicitly declared class or interface

harmonyos next_harmonyos4.0鸿蒙os全套学习地址:

harmonyos next_harmonyos4.0鸿蒙os最新入门实战系列教程_哔哩哔哩_bilibiliharmonyos next_harmonyos4.0鸿蒙os最新入门实战系列教程共计33条视频,包括:harmonyos介绍 、开发环境搭建、deveco详解、目录结构介绍、代码分析、harmonyos模拟器调试 真机调试、arkts页面布局 数据类型 条件判断 数组 foreach循环遍历 list listitem组件详解等,up主更多精彩视频,请关注up账号。icon-default.png?t=n7t8https://www.bilibili.com/video/bv1sc411q7bd

 配套课件及源码网盘下载地址:harmonyos harmonyos next系列教程下载地址-it营大地老师

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:"男"
}

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com