import { edgeColors, router } from ‘@kit.ArkUI’
@Component
struct myNavigation {
@Prop title: string = ‘’
@BuilderParam customRight: () => void = this.defaultRight
@Builder
defaultRight() {
Row()
.width(35)
.height(30)
}
build() {
Row() {
Row(){
Image($r(“app.media.title_left_cancel”)).height(20).margin({
left: 14
})
}.width(50).height(50).onClick(() => {
router.back()
})
Text(this.title)
.layoutWeight(1)
.fontSize(16)
.margin({
left: 10, right: 10
})
.fontColor("#424242").textAlign(TextAlign.Center)
this.customRight()
}.justifyContent(FlexAlign.Center)
.height(50)
}
}
export default myNavigation
// 页面使用
Column() {
myNavigation({
title: ‘’,
customRight: () => {
this.customBarRight()
}
})
}