跳过内容

@capgo/capacitor-pretty-toast

在 iOS、Android 和 Web 上显示原生样式的通知,支持队列、更新、操作、图标和 Promise 状态。

概览

概览

@capgo/capacitor-pretty-toast 提供 toast.* API for native-first toast notifications in Capacitor apps. It renders native overlays on iOS and Android and a DOM renderer on Web.

原生首选的__CAPGO_KEEP_1__通知

演示
演示

在外部设备上展示动画的Pretty Toast

通知流程
  • toast.show - 使用完整配置对象显示自定义toast。
  • toast.success, toast.error, toast.info, toast.warning - 使用标题和可选配置显示常见语义toast。
  • toast.loading - 显示一个持续加载的toast。
  • toast.update - 在原处更新一个现有的toast。
  • toast.promise - 使用加载、成功和错误状态跟踪一个Promise。
  • toast.dismiss - 移除一个toast或清空队列。 toast.dismissAll 公共__CAPGO_KEEP_0__
描述使用完整配置显示一个toast。
toast.show(config, options?)显示一个toast ToastConfig.
toast.success(title, config?, options?)显示成功的toast。
toast.error(title, config?, options?)显示错误的toast。
toast.info(title, config?, options?)显示信息性的toast。
toast.warning(title, config?, options?)显示警告的toast。
toast.loading(title, config?, options?)显示一个不自动消失的加载toast。
toast.update(id, partial)更新一个现有的toast。
toast.promise(promise, messages)显示加载状态,然后更新为成功或错误。
toast.dismiss(id?)消除一个toast或当前的toast。
toast.dismissAll()消除所有可见的和排队的toast。

这个参考是从源同步的 src/definitions.tscapacitor-pretty-toast.

继续从 @capgo/capacitor-pretty-toast

标题:继续从 @capgo/capacitor-pretty-toast

如果您正在使用 @capgo/capacitor-pretty-toast 来规划原生插件工作,连接它到 Capgo Plugin Directory 在 Capgo Plugin Directory 中的产品工作流程 在 Capacitor Plugins by Capgo 中的实现细节 在 Capacitor Plugins by Capgo 中添加或更新插件 继续 在添加或更新插件的实现细节中 Ionic 企业插件替代品 在 Ionic 企业插件替代品的产品工作流程中 Capgo 本机构建 在 Capgo 本机构建的产品工作流程中