Alert 警告提示
警告提示,展现需要关注的信息
平台
| App | 小程序 | H5 |
|---|---|---|
| √ | √ | √ |
属性
| 属性名 | 类型 | 默认值 | 说明 | 平台 |
|---|---|---|---|---|
| type | String | null | 类型 支持primary,success,danger,warning,info | All |
| title | String | null | 标题 | All |
| desc | String | null | 文字描述 | All |
| radius | String,Number | null | 圆角,radius=round时为圆形 | All |
| closable | Boolean | false | 关闭 | All |
| dark | Boolean | false | 是否深色 | All |
| center | Boolean | false | 内容是否居中 | All |
| showIcon | Boolean | false | 显示icon | All |
| icon | String,Object | '' | 自定义icon | All |
| iconPosition | String | 'left' | icon位置 可选的值left,top | All |
| cClass | String,Array,Object | null | 组件类 | All |
| cStyle | String,Array,Object | null | 组件样式 | All |
| margin | String,Number,Array | null | 外边距 | All |
| padding | String,Number,Array | null | 内边距 | All |
| bgColor | String | null | 背景色,支持c-bg-开头的背景色类 | All |
事件
| 事件名 | 说明 |
|---|---|
| click | |
| close | 点击关闭按钮时触发 |
插槽
| 插槽名 | 说明 |
|---|---|
| default | 默认内容下方,用于自定义类容 |
示例
vue
<template>
<c-alert type="primary" title="标题" desc="描述文字" closable dark center showIcon />
</template>1
2
3
2
3
