@uni/alert
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

alert

npm

alert 警告框

支持

browser miniApp wechatMiniprogram bytedanceMicroApp baiduSmartProgram kuaiShouMiniProgram

安装

$ npm install @uni/alert --save

示例

import alert from '@uni/alert';

alert({
  title: 'alert框的标题',
  content: 'alert框的内容',
  buttonText: '按钮文字,默认confirm'
}).then(() => {
  console.log('确定');
});

你也可以从大包引入:

import { alert } from '@uni/apis';

参数

成员 类型 描述 默认值
options object alert 参数 -
options.content string alert 内容 -
options.title string alert 标题 -
options.buttonText string alert 确认按钮文字 -

不通用参数(由于破坏了一码多端的能力,请谨慎使用)

成员 类型 描述 默认值 支持
options.confirmColor string alert 确认按钮颜色 - wechatMiniprogram baiduSmartProgram kuaiShouMiniProgram

注意

部分选项仅微信小程序支持,如 confirmColor 等。用户可直接在 options 中传入,但是不会在其他小程序端生效。

微信小程序

Readme

Keywords

none

Package Sidebar

Install

npm i @uni/alert

Weekly Downloads

0

Version

1.0.8

License

BSD-3-Clause

Unpacked Size

87.9 kB

Total Files

54

Last publish

Collaborators

  • bunko
  • rax-publisher