mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 19:49:59 +08:00
type(message): improve message.info type (#51468)
This commit is contained in:
parent
9067b0f9e5
commit
910a484b69
@ -36,6 +36,19 @@ describe('message.config', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should be able to config top with string value', async () => {
|
||||
message.config({
|
||||
top: '10vh',
|
||||
});
|
||||
|
||||
message.info('test message');
|
||||
await awaitPromise();
|
||||
|
||||
expect(document.querySelector('.ant-message')).toHaveStyle({
|
||||
top: '10vh',
|
||||
});
|
||||
});
|
||||
|
||||
it('should be able to config rtl', async () => {
|
||||
message.config({
|
||||
rtl: true,
|
||||
|
@ -108,7 +108,7 @@ message.config({
|
||||
| maxCount | Max message show, drop oldest if exceed limit | number | - | |
|
||||
| prefixCls | The prefix className of message node | string | `ant-message` | 4.5.0 |
|
||||
| rtl | Whether to enable RTL mode | boolean | false | |
|
||||
| top | Distance from top | number | 8 | |
|
||||
| top | Distance from top | string \| number | 8 | |
|
||||
|
||||
## Design Token
|
||||
|
||||
|
@ -109,7 +109,7 @@ message.config({
|
||||
| maxCount | 最大显示数,超过限制时,最早的消息会被自动关闭 | number | - | |
|
||||
| prefixCls | 消息节点的 className 前缀 | string | `ant-message` | 4.5.0 |
|
||||
| rtl | 是否开启 RTL 模式 | boolean | false | |
|
||||
| top | 消息距离顶部的位置 | number | 8 | |
|
||||
| top | 消息距离顶部的位置 | string \| number | 8 | |
|
||||
|
||||
## 主题变量(Design Token)
|
||||
|
||||
|
@ -3,7 +3,7 @@ import type * as React from 'react';
|
||||
export type NoticeType = 'info' | 'success' | 'error' | 'warning' | 'loading';
|
||||
|
||||
export interface ConfigOptions {
|
||||
top?: number;
|
||||
top?: string | number;
|
||||
duration?: number;
|
||||
prefixCls?: string;
|
||||
getContainer?: () => HTMLElement;
|
||||
|
Loading…
Reference in New Issue
Block a user