mirror of
https://github.com/youzan/vant.git
synced 2025-10-17 16:44:21 +00:00
[new feature] add Notify component (#2135)
This commit is contained in:
2
types/index.d.ts
vendored
2
types/index.d.ts
vendored
@@ -2,6 +2,7 @@ import Vue from 'vue';
|
||||
import { VanComponent } from './component';
|
||||
import { Toast } from './toast';
|
||||
import { Dialog } from './dialog';
|
||||
import { Notify } from './notify';
|
||||
import { Locale } from './locale';
|
||||
import { Lazyload } from './lazyload';
|
||||
import { Waterfall } from './waterfall';
|
||||
@@ -74,6 +75,7 @@ export class Uploader extends VanComponent {}
|
||||
export {
|
||||
Toast,
|
||||
Dialog,
|
||||
Notify,
|
||||
Locale,
|
||||
Lazyload,
|
||||
Waterfall,
|
||||
|
32
types/notify.d.ts
vendored
Normal file
32
types/notify.d.ts
vendored
Normal 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;
|
Reference in New Issue
Block a user