Skip to content

useToast

返回一个方法,调用后显示消息提示框。

typescript
import { useToast } from '@uni-helper/uni-use';

const showToast = useToast({
  /* 传入配置 */
});
const hideToast = showToast(); // 显示消息提示框
hideToast(); // 隐藏消息提示框

可以传入一个对象来更新已有配置,这样会使用 扩展运算符 来确认最终配置。

typescript
showToast({
  /* 新传入配置 */
});

Released under the MIT License.