[new feature] add Notify component (#2135)
This commit is contained in:
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
type NotifyMessage = string | number;
|
||||
|
||||
export type NotifyOptions = {
|
||||
message?: NotifyMessage;
|
||||
color?: string;
|
||||
background?: string;
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
export interface VanNotify extends Vue {
|
||||
message: NotifyMessage;
|
||||
color: string;
|
||||
background: string;
|
||||
duration: number;
|
||||
}
|
||||
|
||||
export interface Notify {
|
||||
(message: NotifyOptions | NotifyMessage): VanNotify;
|
||||
clear(): void;
|
||||
setDefaultOptions(options: NotifyOptions): void;
|
||||
resetDefaultOptions(): void;
|
||||
}
|
||||
|
||||
declare module 'vue/types/vue' {
|
||||
interface Vue {
|
||||
$notify: Notify
|
||||
}
|
||||
}
|
||||
|
||||
export const Notify: Notify;
|
||||
Reference in New Issue
Block a user