博客
关于我
wex5中messageDialog控件
阅读量:551 次
发布时间:2019-03-09

本文共 1009 字,大约阅读时间需要 3 分钟。

JustEP 系统 - 消息对话框控件

在JustEP框架中,messageDialog控件是一种功能强大的 UI 组件,主要用于实现与用户的交互提示。在使用该控件时,我们需要理解其基本用法和相关参数的配置。

1. 使用场景

messageDialog控件主要用于显示提示信息,获取用户的操作响应。其类型包括:

  • OK:仅有确定按钮
  • OKCancel:包含确定和取消按钮
  • YesNo:包含是和否按钮
  • YesNoCancel:包含是、否和取消按钮
  • Prompt:显示输入字段,适合获取用户输入

2. 使用方法

添加控件

在页面上添加messageDialog控件的实现步骤如下:

var messageDialog = this.comp("messageDialog"); // 通过this找到messageDialog控件
显示提示

调用show方法显示提示对话框:

messageDialog.show({    type: 'Prompt',  // 设置控件类型为Prompt    title: '请输入手机号码',  // 设置控件标题    message: '确认要注销吗?',  // 设置控件提示内容    callback: function(par) {  // 设置回调函数        if (par.button == 'ok') {  // 检查用户点击的是确定按钮            alert(11111);  // 显示确认提示        }    }});
回调处理

在回调函数中,可以根据用户的选择获取相关数据或执行操作逻辑。比如,par.button表示用户选择的按钮类型,具体值包括:

  • 'ok'
  • 'cancel'
  • 'yes'
  • 'no'
参数说明
  • type

    控件类型,取值范围:OK、OKCancel、YesNo、YesNoCancel、Prompt

  • par

    传递的参数,包含以下字段:

    • button:触发关闭的按钮类型,可取值为 'ok'、'cancel'、'yes'、'no'
  • 特殊说明

    type 为 'Prompt' 时,value 属性将从 par.par.input 获取,适用于需要用户输入的场景。

  • 通过以上方法,开发者可以灵活地与用户交互,实现各种提示和确认功能。messageDialog控件的易用性和高效性使其成为构建用户友好界面的重要工具。

    转载地址:http://uuwpz.baihongyu.com/

    你可能感兴趣的文章
    Prometheus Grafana 展示平台
    查看>>
    Prometheus pushgateway使用详解
    查看>>
    Prometheus 云原生 - Prometheus 数据模型、Metrics 指标类型、Exporter 相关
    查看>>
    Prometheus 云原生 - 基于 file_sd、http_sd 实现 Service Discovery
    查看>>
    Prometheus 云原生 - 微服务监控报警系统 (Promethus、Grafana、Node_Exporter)部署、简单使用
    查看>>
    Prometheus 云原生 - 监控 Linux、MySQL、Redis、RabbitMQ、Docker、SpringBoot 3.x
    查看>>
    Prometheus 介绍
    查看>>
    Prometheus 安全配置详解
    查看>>
    prometheus 安装node_exporter, node_exporter 安装最新版 普罗米修思安装监控服务器client
    查看>>
    Prometheus 安装部署实战
    查看>>
    prometheus 持久化存储方案
    查看>>
    Prometheus 监控系统企业级实战
    查看>>
    Prometheus 监控系统简介
    查看>>
    Prometheus 配置详解
    查看>>
    Prometheus 采集器使用详解
    查看>>
    Prometheus 黑盒监控实战
    查看>>
    prometheus+alertmanager+grafana监控部署教程
    查看>>
    Prometheus+Grafana构建智能化Kubernetes监控系统实战
    查看>>
    Prometheus+SpringBoot应用监控全过程详解
    查看>>
    Prometheus+SpringBoot应用监控全过程详解
    查看>>