Toast (am-toast)
am-toast 與 ToastProvider 提供全域通知 API(window.toast)。
- 在 layout 掛載
<ToastProvider /> window.toast.show(title, options?)window.toast.info(title, options?)window.toast.success(title, options?)window.toast.warning(title, options?)window.toast.error(title, options?)
options 目前支援:
description?: stringtype?: "info" | "success" | "warning" | "error"(showonly)duration?: numberclosable?: boolean
<ToastProvider />window.toast?.success("Completed", { description: "All components have been updated.", duration: 4000,});目前 contract 是 client-side global provider,不是可序列化的 page block。