# toast(已废除,请使用showToast)
toast弹窗
# 调用方式
toast(message, duration = 1.5, bgStyle)
1
返回 Promise,使用 then/catch 或 await 处理结果。 仅当宿主提供此能力时导出,调用前可判断方法是否存在。
# 请求参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| message | String | Y | — | 需要展示的提示文本 |
| duration | Number | N | 1.5 | 提示持续时间,单位秒 |
| bgStyle | String | N | 未设置 | 显式背景样式;未设置时可根据页面主题补充 white |
# 接口调用示例
this.$bridge.toast('操作完成', 1.5)
.catch(error => console.error(error))
1
2
2
# 返回参数
返回 Promise;当前实现先处理主题样式,再调用原生 toast。