鸿蒙之路的坑
1、系统
 Windows 10 家庭版不可用模拟器
 对应的解决方案【坑】
 升级系统版本
 
 直接更改密钥可自动升级系统
 密钥找对应系统的(例:windows 10专业版)
 升级完之后要激活
 坑1、升级完后事先创建好的模拟器还是无法启动
 解决:删除模拟器,重新创建
 坑2、事先创建的项目无法运行到模拟器上,报错
 
 百度解决后依然不行添加链接描述
 解决:重新创建项目,可正常运行。
开始鸿蒙之路
一、接口请求:
1、原生的:
二、数据存储:
数据存储数据持久化
 坑、PersistentStorage预览模式可以,模拟器上获取不到数据,相同配置别人没事!!!
 解决:卸载重新安装,每次修改都得卸载重新安装
 PersistentStorage.persistProp('token', '我是token圆圆的') // PersistentStorage.deleteProp('token') console.log('持久化'+PersistentStorage.keys()) console.log('持久化'+AppStorage.get('token'))
2、axios的:
三、组件
1、button
2、text
3、image
4、Grid
官方文档
5、Tabs
选项卡 (Tabs)
6、List
7、TextInput
TextInput
@State searchKey: string = ''controller: TextInputController = new TextInputController()
TextInput({ placeholder: '请输入搜索名称', text: this.searchKey, controller: this.controller }).width('85%').backgroundColor('#fff').borderRadius(4).shadow({ radius: 4, color: Color.Gray }).onChange((value) => {this.searchKey = valueconsole.log('搜索内容' + this.searchKey)})//清空直接赋值this.searchKey=‘’
四、
 1、页面跳转
 页面跳转
生命周期
