A simple popup alert plugin for Vue3 and TailwindCSS
showToast: 轻量级提示框 | Lightweight toast notificationshowModal: 模态对话框 | Modal dialog boxshowLoading: 加载状态提示 | Loading state indicatorhideLoading: 关闭加载状态 | Hide loading state
@import "tailwindcss";
/* 自定义动画 */
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.animate-spin {
animation: spin 1.2s linear infinite;
}
参数 | Parameters:
icon: "success" | "error" | "loading" | "none"
function showToast() {
seaAlert.showToast({
title: 'showToast',
// icon: 'none',
// icon: 'error',
// icon: 'loading',
// icon: 'success',
});
}参数 | Parameters:
title: stringcontent: stringshowCancel: booleancancelText: stringcancelColor: stringconfirmText: stringconfirmColor: stringmask: boolean
function showModal() {
seaAlert.showModal({
content: 'showModal',
// showCancel: false,
// success: (res) => {
// if (res.confirm) {
// console.log('用户点击了确定');
// // 执行确定操作 | Execute confirm action
// } else {
// console.log('用户点击了取消');
// }
// }
});
}showLoading 参数 | Parameters:
title: stringmask: boolean
function showLoading() {
seaAlert.showLoading({ title: '加载中...'});
setTimeout(() => {
seaAlert.hideLoading();
}, 2000);
}- Vue 3
- TailwindCSS