# ks.showModal

显示模态对话框。

# showModal(options: ShowModalOptions): Promise<ShowModalResult>

# 参数

参数 类型 必填
options ShowModalOptions

# ShowModalOptions

属性
属性 类型 默认值 必填 说明
title string 提示的标题
content string 提示的内容
showCancel boolean true 是否显示取消按钮
cancelText string '取消' 取消按钮的文字,最多 4 个字符
cancelColor string '#000000' 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串
confirmText string '确定' 确认按钮的文字,最多 4 个字符
confirmColor string '#576B95' 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串
placeholderText string 显示输入框时的提示文本
editable boolean false 是否显示输入框
success (result: ShowModalResult) => void 接口调用成功的回调函数
fail (error: APIError) => void 接口调用失败的回调函数
complete (resultOrError: ShowModalResult | APIError) => void 接口调用结束的回调函数(调用成功、失败都会执行)

# 返回值

# Promise<ShowModalResult>

ShowModalResult
属性
属性 类型 说明
confirm boolean 为 true 时,表示用户点击了确定按钮
cancel boolean 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭)
content string editable 为 true 时,用户输入的文本
Copyright ©2024, All Rights Reserved