啊鑫
2025-07-17 eaa506e57403d1b8502f16ca5dd6e82c347724d0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import Vue from 'vue';
import { VanComponent } from './component';
 
export type NotifyMessage = string | number;
 
export type NotifyOptions = {
  type?: 'primary' | 'success' | 'danger' | 'warning';
  value?: boolean;
  color?: string;
  message?: NotifyMessage;
  duration?: number;
  className?: any;
  background?: string;
  onClose?: (() => void) | null;
  onOpened?: (() => void) | null;
  onClick?: ((event: Event) => void) | null;
};
 
export interface VanNotify extends Vue {
  message: NotifyMessage;
  color: string;
  background: string;
  duration: number;
}
 
export interface Notify {
  (message: NotifyOptions | NotifyMessage): VanNotify;
  clear(): void;
  install(): void;
  currentOptions: NotifyOptions;
  defaultOptions: NotifyOptions;
  setDefaultOptions(options: NotifyOptions): void;
  resetDefaultOptions(): void;
  Component: typeof VanComponent;
}
 
declare module 'vue/types/vue' {
  interface Vue {
    $notify: Notify;
  }
}
 
export const Notify: Notify;