fixed bug of notice when has render and title bug no desc
This commit is contained in:
parent
6b2cd6742a
commit
efc65a34ff
2 changed files with 17 additions and 2 deletions
|
@ -6,6 +6,7 @@
|
|||
<Button @click="success(false)">成功</Button>
|
||||
<Button @click="warning(false)">警告</Button>
|
||||
<Button @click="error(false)">错误</Button>
|
||||
<Button @click="testRender()">render</Button>
|
||||
<p>仅标题</p>
|
||||
<Button @click="info(true)">消息</Button>
|
||||
<Button @click="success(true)">成功</Button>
|
||||
|
@ -54,7 +55,7 @@
|
|||
warning (nodesc) {
|
||||
this.$Notice.warning({
|
||||
title: '这是通知标题',
|
||||
desc: nodesc ? '' : '这里是通知描述这里,是通知描述这里是通知描述这里,是通知描述这里,是通知描述这里是通知描述这里是通知描述'
|
||||
desc: nodesc ? '' : '这里是通知描述这里,是通知描述这里是通知描述这里,是通知描述这里,是通知描述这里是通知描述这里是通知描述',
|
||||
});
|
||||
},
|
||||
error (nodesc) {
|
||||
|
@ -63,6 +64,20 @@
|
|||
desc: nodesc ? '' : '这里是通知描述这里,是通知描述这里是通知描述这里,是通知描述这里,是通知描述这里是通知描述这里是通知描述'
|
||||
});
|
||||
},
|
||||
testRender () {
|
||||
this.$Notice.info({
|
||||
title: '这是通知标题',
|
||||
duration: 0,
|
||||
// desc: '当你定义了render之后,这个描述会被覆盖',
|
||||
render: h => {
|
||||
return h('span', {}, [
|
||||
'这是',
|
||||
h('Button', {props: {type: 'text'}}, 'render'),
|
||||
'函数渲染的'
|
||||
]);
|
||||
},
|
||||
});
|
||||
},
|
||||
destroy () {
|
||||
this.$Notice.destroy();
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ function notice (type, options) {
|
|||
|
||||
let withIcon;
|
||||
|
||||
const with_desc = (options.render && !title) ? '' : desc === '' ? '' : ` ${prefixCls}-with-desc`;
|
||||
const with_desc = (options.render && !title) ? '' : (desc || options.render) ? ` ${prefixCls}-with-desc` : '';
|
||||
|
||||
if (type == 'normal') {
|
||||
withIcon = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue