当前位置:   article > 正文

HarmonyOS NEXT创建对象提示Object literal must correspond to some explicitly declared class or interface

object literal must correspond to some explicitly declared class or interfac

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

  1. let userinfo={
  2. username:"张三",
  3. age:20,
  4. sex:"男"
  5. }

解决办法:

  1. interface UserInfoInterface{
  2. username:string,
  3. age:number,
  4. sex:string
  5. }
  6. let userinfo:UserInfoInterface={
  7. username:"张三",
  8. age:20,
  9. sex:"男"
  10. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/759955
推荐阅读