[new feature] add Notify component (#2135)

This commit is contained in:
neverland
2018-11-25 10:36:07 +08:00
committed by GitHub
parent 00458839a2
commit eb44209a5a
22 changed files with 465 additions and 5 deletions
+32
View File
@@ -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;