showtips
v1.0.5
Published
Small pop-up window
Downloads
3
Readme
showtips.js
此包可以快速为您创建toast弹窗 若需显示图标 请引入iconfont图标链接
@import '//at.alicdn.com/t/c/font_3207837_h91rrf65lj.css';
使用
npm i showtips
import toast from 'showtips'
toast.showToast(1, "成功")
toast.showToast(2, "错误")
toast.showToast(3, "警告")
toast.showToast(4, "通知")
//也可
toast.showToast("success","成功")
// ["get", "success", "suc", "ok", "zhengque", "chenggong"]
// ["error", "wrong", "fail", "failed", "shibai", "cuowu"]
// ["warn", "warnning", "jinggao"]
// ["info", "information", "tip", "notice", "gonggao", "tishi"]
// 使用字符串时不可颠倒参数
//或
// 使用数字时可以颠倒参数
toast.showToast("成功",1)
// 不加参数默认是成功
toast.showToast("成功")
toast.closeToast() //提前(手动)关闭弹窗
toast.showModal(2, "确定吗?", (confirm) => {
if (confirm) {
// your code
}
})() //显示模态框
@keyframes loading {
to {
transform: rotate(360deg);
}
}