feat: 前端完成适配后端api
This commit is contained in:
@@ -50,10 +50,31 @@ const [useAlertProvider, useAlertStore] = createInjectionState(() => {
|
||||
}
|
||||
}
|
||||
|
||||
// Convenience methods for different alert types
|
||||
function error(message: string, duration = 2000) {
|
||||
show(message, "error", duration);
|
||||
}
|
||||
|
||||
function info(message: string, duration = 2000) {
|
||||
show(message, "info", duration);
|
||||
}
|
||||
|
||||
function warn(message: string, duration = 2000) {
|
||||
show(message, "warning", duration);
|
||||
}
|
||||
|
||||
function success(message: string, duration = 2000) {
|
||||
show(message, "success", duration);
|
||||
}
|
||||
|
||||
return {
|
||||
alertState,
|
||||
show,
|
||||
hide,
|
||||
error,
|
||||
info,
|
||||
warn,
|
||||
success,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user