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)
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ export struct AppListPage {
|
||||
Column() {
|
||||
Text(`${this.refreshTick}-${this.refreshToken}`).fontSize(1).opacity(0)
|
||||
PageHeader({ title: '应用列表' })
|
||||
StatusBanner({ text: '运行入口:点击“可运行”应用卡片进入运行页;导入入口:点击下方“导入应用”。' })
|
||||
if (this.selectedAppId) {
|
||||
StatusBanner({ text: `已选择应用:${this.selectedAppId}` })
|
||||
}
|
||||
@@ -81,6 +82,7 @@ export struct AppListPage {
|
||||
items: this.store.items,
|
||||
onItemTap: (appId: string) => this.openRunPage(appId)
|
||||
})
|
||||
ImportEntryButton({ onTap: () => this.openImportPage() })
|
||||
}
|
||||
}
|
||||
.width('100%')
|
||||
|
||||
@@ -64,6 +64,8 @@ export struct RunPage {
|
||||
StatusBanner({ text: this.store.error.message })
|
||||
}
|
||||
RuntimeToolbar({
|
||||
canRestart: this.store.canRestart,
|
||||
canExit: this.store.canExit,
|
||||
onBack: () => this.onBackClick(),
|
||||
onRestart: () => this.onRestart(),
|
||||
onExit: () => this.onExit()
|
||||
|
||||
Reference in new issue
Block a user