Skip to content

Toast 通知

全局通知系统,用于显示简短的消息反馈。

使用方法

全局配置

首先需要在应用入口包裹 ToastProvider

SXO Framework Switcher
🚧
This example is not yet available for .

发送通知

使用 useToast 钩子发送通知:

SXO Framework Switcher
🚧
This example is not yet available for .

属性

Toast Options

属性类型默认值说明
titlestring-标题
descriptionstring-描述内容
type'info' | 'success' | 'warning' | 'error''info'通知类型
durationnumber3000显示时长(毫秒),设为 0 则不自动关闭
position'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right''top-right'显示位置