feat: tighten ArkTS shell demo closure and runtime entry hints
This commit is contained in:
1 parent
a14b10d62f
commit
bde990ac82
4 files changed
+102
-10
No files matched your search
@@ -3,6 +3,8 @@ export struct RuntimeToolbar {
|
||||
onBack?: () => void
|
||||
onRestart?: () => void
|
||||
onExit?: () => void
|
||||
@Prop canRestart: boolean = true
|
||||
@Prop canExit: boolean = true
|
||||
|
||||
build() {
|
||||
Row({ space: 12 }) {
|
||||
@@ -11,16 +13,20 @@ export struct RuntimeToolbar {
|
||||
this.onBack()
|
||||
}
|
||||
})
|
||||
Button('重启').onClick(() => {
|
||||
if (this.onRestart) {
|
||||
this.onRestart()
|
||||
}
|
||||
})
|
||||
Button('退出').onClick(() => {
|
||||
if (this.onExit) {
|
||||
this.onExit()
|
||||
}
|
||||
})
|
||||
Button('重启')
|
||||
.enabled(this.canRestart)
|
||||
.onClick(() => {
|
||||
if (this.onRestart) {
|
||||
this.onRestart()
|
||||
}
|
||||
})
|
||||
Button('退出')
|
||||
.enabled(this.canExit)
|
||||
.onClick(() => {
|
||||
if (this.onExit) {
|
||||
this.onExit()
|
||||
}
|
||||
})
|
||||
}
|
||||
.padding(16)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user