feat: ✨ 全局crud的ElNotification提示,ElNotification的封装
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { ElMessage, MessageOptions } from 'element-plus';
|
||||
import { ElMessage, ElNotification, MessageOptions } from 'element-plus';
|
||||
|
||||
export function message(message: string, option?: MessageOptions) {
|
||||
ElMessage({ message, ...option });
|
||||
}
|
||||
export function successMessage(message: string, option?: MessageOptions) {
|
||||
ElMessage({ message, ...option, type: 'success' });
|
||||
ElMessage({ message, type: 'success' });
|
||||
}
|
||||
export function warningMessage(message: string, option?: MessageOptions) {
|
||||
ElMessage({ message, ...option, type: 'warning' });
|
||||
@@ -15,3 +15,19 @@ export function errorMessage(message: string, option?: MessageOptions) {
|
||||
export function infoMessage(message: string, option?: MessageOptions) {
|
||||
ElMessage({ message, ...option, type: 'info' });
|
||||
}
|
||||
|
||||
export function notification(message: string) {
|
||||
ElNotification({ message });
|
||||
}
|
||||
export function successNotification(message: string) {
|
||||
ElNotification({ message, type: 'success' });
|
||||
}
|
||||
export function warningNotification(message: string) {
|
||||
ElNotification({ message, type: 'warning' });
|
||||
}
|
||||
export function errorNotification(message: string) {
|
||||
ElNotification({ message, type: 'error' });
|
||||
}
|
||||
export function infoNotification(message: string) {
|
||||
ElNotification({ message, type: 'info' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user