feat: message support custom style and class #3443

pull/3448/head
tanjinzhou 2020-12-25 14:44:47 +08:00
parent 674933ae60
commit 123d04d1ef
1 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import { VNodeTypes } from 'vue'; import { CSSProperties, VNodeTypes } from 'vue';
import Notification from '../vc-notification'; import Notification from '../vc-notification';
import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined'; import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined';
import ExclamationCircleFilled from '@ant-design/icons-vue/ExclamationCircleFilled'; import ExclamationCircleFilled from '@ant-design/icons-vue/ExclamationCircleFilled';
@ -66,6 +66,8 @@ export interface ArgsProps {
onClose?: () => void; onClose?: () => void;
icon?: VNodeTypes; icon?: VNodeTypes;
key?: string | number; key?: string | number;
style?: CSSProperties;
class?: string;
} }
function notice(args: ArgsProps): MessageType { function notice(args: ArgsProps): MessageType {
@ -85,7 +87,8 @@ function notice(args: ArgsProps): MessageType {
instance.notice({ instance.notice({
key: target, key: target,
duration, duration,
style: {}, style: args.style || {},
class: args.class,
content: () => { content: () => {
return ( return (
<div <div