跳过内容

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

原生提示通知的原生首选项。它在 iOS 和 Android 上渲染原生覆盖层,在 Web 上渲染 DOM 渲染器。

在外部设备上显示动画式的提示信息
提示信息流程
  • toast.show - 使用全配置对象显示自定义提示信息。
  • toast.success, toast.error, toast.info, toast.warning - 使用标题和可选配置显示常见的语义提示信息。
  • toast.loading - 显示一个持续加载的提示信息。
  • toast.update - 在原位置更新一个提示信息。
  • toast.promise - 使用加载、成功和错误状态跟踪一个Promise。
  • toast.dismiss and toast.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 为了计划原生插件工作,连接它与 Capgo 原生插件目录 在Capgo 原生插件目录中, Capacitor 插件由Capgo 在Capacitor 插件由Capgo中, 添加或更新插件 在添加或更新插件中, Ionic企业版插件替代品 在Ionic企业版插件替代品中, Capgo 原生构建 在Capgo 原生构建中,