十年匠心定制 · 商业建站与技术教学双线并行 咨询热线:400-886-1026 service@lmnt.cn
ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

Harmony鸿蒙项目-鸿蒙实战开发-记事本「登录保护」【源码在文末】

Harmony鸿蒙项目-鸿蒙实战开发-记事本「登录保护」【源码在文末】 Harmony鸿蒙项目-鸿蒙项目-鸿蒙实战开发-记事本「登录保护」【源码在文末】文章目录Harmony鸿蒙项目-鸿蒙项目-鸿蒙实战开发-记事本「登录保护」【源码在文末】一、运行演示1、注册2、登录3、主页4、编写二、部分代码三、源码运行工具DevEco Studio一、运行演示1、注册2、登录3、主页4、编写二、部分代码import router from ohos.router import { NoteInfo } from ../model/data import { DBUtil } from ../util/DBUtil Entry Component struct Home { State arr: NoteInfo[] [] async onPageShow(){ this.arr await DBUtil.queryNote() } build() { Column(){ Row() { Row() { Blank() Text($r(app.string.add)) .fontSize(24) .fontWeight(400) .fontColor(Color.White) .width(50) .onClick(() { router.pushUrl({ url: pages/New }) }) }.width(100%) .padding(10) } .width(100%) .height(60) .linearGradient({ direction: GradientDirection.Bottom, colors: [#F1F3F5, 0.5, [#725A4E, 1]] }) List({space: 10}){ ForEach(this.arr,(item: NoteInfo,index: number) { ListItem(){ Column({space: 3}){ Text(item.title) .fontSize(20) .fontWeight(FontWeight.Bold) Text(item.content) .maxLines(1) .textOverflow({overflow: TextOverflow.Ellipsis}) Text(item.crateTime) .fontSize(13) .fontColor(#ff9f9f9f) } .onClick(() { router.pushUrl({ url: pages/Old, params: item }) }) .backgroundColor(Color.White) .borderRadius(5) .padding(10) .justifyContent(FlexAlign.Center) .alignItems(HorizontalAlign.Start) .width(100%) } .width(100%) }) } .layoutWeight(1) .width(100%) } .backgroundColor(#ffeeeeee) .width(100%) .height(100%) .padding(10) } }三、源码相关鸿蒙项目点此专栏部分内容来源于网络若有侵权及时联系我收到后会及时删除通过百度网盘分享的文件…zip 链接百度网盘 请输入提取码文件已经加密请点击下方名片获取源码或Lvnvn0508
返回列表