创建导航页
@Entry
@Component
struct Index {
@Provide('pathInfos') pathInfos: NavPathStack = new NavPathStack()
build() {
Navigation(this.pathInfos) {
}
}
}
创建导航子页
this.navPath.pushPathByName('AccountTag', '账本分类管理')
@Builder
export function AccountTag(name: string, param: string) {
page({ name: name, label: param })
}
@Component
export struct page {
name: string = '';
label: string = '';
build() {
NavDestination() {
}
.title(this.label)
}
}
创建路由跳转
{
"module": {
"routerMap": "$profile:route_map",
}
}
{
"routerMap" : [{
"name" : "AccountTag",
"pageSourceFile" : "src/main/ets/pages/mine/AccountTag.ets",
"buildFunction" : "AccountTag"
}]
}