@uni/alert
v1.0.8
Published
[](https://www.npmjs.com/package/@uni/alert)
Readme
alert
Alert component for feedback.
Support
Install
$ npm install @uni/alert --saveUsage
import alert from '@uni/alert';
alert({
title: 'alert title',
content: 'alert content',
buttonText: 'button text,default value is confirm'
}).then(() => {
console.log('confirm');
});You can also import from the big package:
import { alert } from '@uni/apis';
Arguments
| Property | Type | Description | Default |
| ------------------ | -------- | ------------ | :-------: |
| options | object | alert arguments | - |
| options.content | string | alert content | - |
| options.title | string | alert 标题 | - |
| options.buttonText | string | alert 确认按钮文字 | - |
不通用参数(由于破坏了一码多端的能力,请谨慎使用)
| 成员 | 类型 | 描述 | 默认值 | 支持 |
| ------------------ | -------- | ---------- | :-------: | :----------: |
| options.confirmColor | string | alert 确认按钮颜色 | - | |
Attention
Options that only supported by WeChat MiniProgram like confirmColor can also be passed but will not effect in other miniapp platforms.
