• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import router from '@ohos.router';
2
3interface ListCategories {
4  title:string,
5  utl:string
6}
7
8@Entry
9@Component
10struct Offset {
11  scroller: Scroller = new Scroller()
12  @State message: string = 'Search'
13  @State items : ListCategories[] = [
14    {title:'MenuOffset',utl:'pages/BindContextMenu/bindContextMenus/UIConsistency/MenuOffset/MenuOffset'},
15  ]
16
17  build() {
18    Scroll(this.scroller) {
19      Column() {
20        List({space:'10vp'}) {
21          ForEach(this.items,(item : ListCategories) => {
22            ListItem() {
23              Text(item.title).fontSize(16).fontWeight(FontWeight.Bold).onClick(() => {
24                router.pushUrl({url:item.utl})
25              })
26            }.width('90%').height('40vp').backgroundColor('#ff53ecd9').borderRadius(10)
27          })
28        }.alignListItem(ListItemAlign.Center).margin({top:'10vp'}).width('100%').height('90%')
29      }.width('100%').height('100%')
30    }.height('100%')
31  }
32}