Commit e49f796318ce451efa0c47b51d1236ff90efb26c
1 parent
7a737482
Alert add banner prop
Alert add banner prop
Showing
3 changed files
with
13 additions
and
4 deletions
Show diff stats
src/components/alert/alert.vue
| ... | ... | @@ -36,7 +36,11 @@ |
| 36 | 36 | showIcon: { |
| 37 | 37 | type: Boolean, |
| 38 | 38 | default: false |
| 39 | - } | |
| 39 | + }, | |
| 40 | + banner: { | |
| 41 | + type: Boolean, | |
| 42 | + default: false | |
| 43 | + }, | |
| 40 | 44 | }, |
| 41 | 45 | data () { |
| 42 | 46 | return { |
| ... | ... | @@ -51,7 +55,8 @@ |
| 51 | 55 | `${prefixCls}-${this.type}`, |
| 52 | 56 | { |
| 53 | 57 | [`${prefixCls}-with-icon`]: this.showIcon, |
| 54 | - [`${prefixCls}-with-desc`]: this.desc | |
| 58 | + [`${prefixCls}-with-desc`]: this.desc, | |
| 59 | + [`${prefixCls}-with-banner`]: this.banner | |
| 55 | 60 | } |
| 56 | 61 | ]; |
| 57 | 62 | }, | ... | ... |
src/styles/components/alert.less
test/routers/alert.vue
| 1 | 1 | <template> |
| 2 | - <Alert show-icon>消息提示文案</Alert> | |
| 2 | + <Alert show-icon banner closable>消息提示文案</Alert> | |
| 3 | 3 | <Alert type="success" show-icon>成功提示文案</Alert> |
| 4 | - <Alert type="warning" show-icon>警告提示文案</Alert> | |
| 4 | + <Alert type="warning" show-icon banner>警告提示文案</Alert> | |
| 5 | 5 | <Alert type="error" show-icon>错误提示文案</Alert> |
| 6 | 6 | <Alert show-icon> |
| 7 | 7 | 消息提示文案 | ... | ... |