通知 Toast
显示重要的全局通知信息。
Options
| 属性 | 描述 | 类型 | 推荐值 | 默认 |
|---|---|---|---|---|
| message | 提示语 | string | - | - |
| type | 类型 | success warning danger normal | - | normal |
| duration | 持续时间(ms),设置为 0 则永久展示 | number | - | 4500 |
| action | 按钮文案 | string | - | - |
| handler | 按钮回调 | function | - | - |
Methods
| 方法名 | 描述 | 类型 | 推荐值 | 默认 |
|---|---|---|---|---|
| success | 成功 | (message: string) => ComponentInternalInstance | - | - |
| warning | 警告 | (message: string) => ComponentInternalInstance | - | - |
| danger | 失败 | (message: string) => ComponentInternalInstance | - | - |
| close | 关闭指定 GToast | (instance: ComponentInternalInstance) => ComponentInternalInstance | - | - |
| closeAll | 移除所有 GToast | () => void | - | - |