udpate notice

This commit is contained in:
zhigang.li 2017-12-21 16:42:23 +08:00
parent baa75b0aef
commit 3f7a5f1a27
7 changed files with 22 additions and 7 deletions

View file

@ -13,7 +13,7 @@
info () {
// this.$Message.info('');
this.$Message.success({
// content: '2',
content: '这是一条普通提示2',
duration: 500,
onClose () {
// console.log(123)

View file

@ -37,11 +37,18 @@
}
});
},
success (nodesc) {
success () {
this.$Notice.success({
title: '这是通知标题',
duration: 0,
desc: nodesc ? '' : '这里是通知描述这里,是通知描述这里是通知描述这里,是通知描述这里,是通知描述这里是通知描述这里是通知描述'
desc: '当你定义了render之后这个描述会被覆盖',
render: h => {
return h('span', {}, [
'这是',
h('Button', {props: {type: 'text'}}, 'render'),
'函数渲染的'
]);
},
duration: 0
});
},
warning (nodesc) {

View file

@ -19,6 +19,11 @@
<Tag type="dot" closable color="#EF6AFF" checkable>标签三</Tag>
<Tag closable color="default" checkable>标签四</Tag>
<br><br>
<Tag closable color="#EF6AFF">标签一</Tag>
<Tag type="border" closable color="#EF6AFF">标签二</Tag>
<Tag type="dot" closable color="#EF6AFF">标签三</Tag>
<Tag closable color="default">标签四</Tag>
<br><br>
<Tag type="border" closable color="blue" checkable>标签一</Tag>
<Tag type="border" closable color="green">标签二</Tag>
<Tag type="border" closable color="red">标签三</Tag>

View file

@ -54,6 +54,7 @@
render: {
type: Function
},
hasTitle: Boolean,
styles: {
type: Object,
default: function() {
@ -111,7 +112,7 @@
contentWithIcon () {
return [
this.withIcon ? `${this.prefixCls}-content-with-icon` : '',
this.render && !this.title && this.withIcon ? `${this.prefixCls}-content-with-render-notitle` : ''
!this.hasTitle && this.withIcon ? `${this.prefixCls}-content-with-render-notitle` : ''
];
},
messageClasses () {

View file

@ -9,6 +9,7 @@
:content="notice.content"
:duration="notice.duration"
:render="notice.render"
:has-title="notice.hasTitle"
:withIcon="notice.withIcon"
:closable="notice.closable"
:name="notice.name"

View file

@ -76,6 +76,7 @@ function notice (type, options) {
content: content,
withIcon: withIcon,
render: render,
hasTitle: !!title,
onClose: onClose,
closable: true,
type: 'notice'

View file

@ -51,7 +51,7 @@
return [
`${prefixCls}`,
{
[`${prefixCls}-${this.color}`]: !!this.color,
[`${prefixCls}-${this.color}`]: !!this.color && oneOf(this.color, initColorList),
[`${prefixCls}-${this.type}`]: !!this.type,
[`${prefixCls}-closable`]: this.closable,
[`${prefixCls}-checked`]: this.isChecked
@ -75,7 +75,7 @@
if (this.type === 'dot') {
return '';
} else if (this.type === 'border') {
return `${prefixCls}-color-${this.color}`;
return oneOf(this.color, initColorList) ? `${prefixCls}-color-${this.color}` : '';
} else {
return this.color !== undefined ? (this.color === 'default' ? '' : 'rgb(255, 255, 255)') : '';
}