0
点赞
收藏
分享

微信扫一扫

docker:基于Dockerfile镜像制作完整案例

promptAction.showToast(文本提示框)

在这里插入图片描述
完整代码:

import { promptAction } from '@kit.ArkUI'

@Entry
@Component
struct Demo1 {
  build() {
    Column(){
      Button('点击我,弹出提示文本框!').onClick(_=>{
        promptAction.showToast({
          message: 'Hello World!',
          duration:2000
        })
      })

    }.height('100%').width('100%').justifyContent(FlexAlign.Center)
  }
}

promptAction.showDialog(对话框)

import { promptAction } from '@kit.ArkUI'

@Entry
@Component
struct Demo1 {
  build() {
   Button('点击出现对话框!').onClick(async _=>{
     await promptAction.showDialog({
       title:'Title标题',
       message:'Message Info',
       buttons:[
         {
           text:'button1',
           color:'#000000'
         },
         {
           text:'button2',
           color:'#000000'
         }
       ],
     })
   }).width(200).height('80')
  }
}
举报

相关推荐

0 条评论