HarmonyOS 鸿蒙Next ArkTs点击退出代码怎么写啊?
HarmonyOS 鸿蒙Next ArkTs点击退出代码怎么写啊?
只知道要用app.terminate()
;但是代码怎么试都不对,萌新求助(www)
import app from '@system.app';
@Component
struct Index {
@State message: string = 'Hello World'
terminate(){
app.terminate();
}
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
.onClick(
() => {
this.terminate()
}
)
}
.width('100%')
}
.height('100%')
}
}
// 点击Hello World退出程序
更多关于HarmonyOS 鸿蒙Next ArkTs点击退出代码怎么写啊?的实战教程也可以访问 https://www.itying.com/category-93-b0.html