轻提示工具
Methods
(inner) error(err, options)
异常类型提示
Parameters:
Name | Type | Description |
---|---|---|
err |
string | function | object | 异常内容 |
options |
object | undefined | 提示参数 |
Example
// 字符串
Toast.error('操作失败');
// Error对象
Toast.error(new Error('网络异常'));
// JSON对象
Toast.error({ message: '数据主键冲突' });
(inner) info(message, options)
普通类型提示
Parameters:
Name | Type | Description |
---|---|---|
message |
string | 消息内容 |
options |
object | undefined | 提示参数 |
Example
Toast.info('你有新的消息!');
// light主题
Toast.info('你有10条信息', { theme: 'light' });
// dark主题
Toast.info('你有10条信息', { theme: 'dark' });
(inner) success(message, options)
成功类型提示
Parameters:
Name | Type | Description |
---|---|---|
message |
string | 消息内容 |
options |
object | undefined | 提示参数 |
Example
Toast.success('操作成功')
(inner) warning(message, options)
警告类型提示
Parameters:
Name | Type | Description |
---|---|---|
message |
string | 消息内容 |
options |
object | undefined | 提示参数 |
Example
Toast.warning('警告消息');