跳过内容

@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.

原生首选项的 Toast 通知 __CAPGO_KEEP_1__ 应用中。它在 iOS 和 Android 上渲染原生覆盖层,在 Web 上渲染 DOM 渲染器。

在外部设备上展示动画式的提示
提示通知流程
  • toast.show - 使用全配置对象显示自定义提示。
  • toast.success, toast.error, toast.info, toast.warning - 使用标题和可选配置显示常见语义提示。
  • toast.loading - 显示持续加载提示。
  • toast.update - 在原处更新现有提示。
  • toast.promise - 跟踪一个带有加载、成功和错误状态的 promise。
  • toast.dismisstoast.dismissAll - 移除一个 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 为native插件工作做出计划,连接它与 Capgo 插件目录 产品工作流程在 Capgo 插件目录中 Capacitor 插件由 Capgo 产品工作流程在 Capacitor 插件由 Capgo 中 添加或更新插件 产品工作流程在添加或更新插件中 Ionic企业插件替代品 产品工作流程在 Ionic企业插件替代品中,以及 Capgo 本机构建 产品工作流程在 Capgo 本机构建中。