mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[Improvement] update type definition (#1294)
This commit is contained in:
parent
90609bf30e
commit
b479c1daa6
@ -1,4 +1,5 @@
|
|||||||
## DatetimePicker
|
## DatetimePicker
|
||||||
|
The DatetimePicker component is usually used with [Popup](#/en-US/popup) Component.
|
||||||
|
|
||||||
### Install
|
### Install
|
||||||
``` javascript
|
``` javascript
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
## DatetimePicker 时间选择
|
## DatetimePicker 时间选择
|
||||||
|
时间选择组件通常与 [弹出层](#/zh-CN/popup) 组件配合使用
|
||||||
|
|
||||||
### 使用指南
|
### 使用指南
|
||||||
``` javascript
|
``` javascript
|
||||||
|
1
types/component.d.ts
vendored
1
types/component.d.ts
vendored
@ -1,3 +1,4 @@
|
|||||||
export class VanComponent {
|
export class VanComponent {
|
||||||
static name: string;
|
static name: string;
|
||||||
|
install(): void;
|
||||||
}
|
}
|
||||||
|
3
types/dialog.d.ts
vendored
3
types/dialog.d.ts
vendored
@ -16,6 +16,9 @@ export interface Dialog {
|
|||||||
alert(options: DialogOptions): Promise<any>;
|
alert(options: DialogOptions): Promise<any>;
|
||||||
confirm(options: DialogOptions): Promise<any>;
|
confirm(options: DialogOptions): Promise<any>;
|
||||||
close(): void;
|
close(): void;
|
||||||
|
install(): void;
|
||||||
|
setDefaultOptions(options: DialogOptions): void;
|
||||||
|
resetDefaultOptions(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'vue/types/vue' {
|
declare module 'vue/types/vue' {
|
||||||
|
1
types/image-preview.d.ts
vendored
1
types/image-preview.d.ts
vendored
@ -7,6 +7,7 @@ export class VanImagePreview extends VanPopupMixin {
|
|||||||
|
|
||||||
export interface ImagePreview {
|
export interface ImagePreview {
|
||||||
(images: string[], startPosition?: number): VanImagePreview;
|
(images: string[], startPosition?: number): VanImagePreview;
|
||||||
|
install(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ImagePreview: ImagePreview;
|
export const ImagePreview: ImagePreview;
|
||||||
|
5
types/index.d.ts
vendored
5
types/index.d.ts
vendored
@ -2,6 +2,7 @@ import Vue from 'vue';
|
|||||||
import { VanComponent } from './component';
|
import { VanComponent } from './component';
|
||||||
import { Toast } from './toast';
|
import { Toast } from './toast';
|
||||||
import { Dialog } from './dialog';
|
import { Dialog } from './dialog';
|
||||||
|
import { Locale } from './locale';
|
||||||
import { Lazyload } from './lazyload';
|
import { Lazyload } from './lazyload';
|
||||||
import { Waterfall } from './waterfall';
|
import { Waterfall } from './waterfall';
|
||||||
import { ImagePreview } from './image-preview';
|
import { ImagePreview } from './image-preview';
|
||||||
@ -21,6 +22,7 @@ export class CellGroup extends VanComponent {}
|
|||||||
export class CellSwipe extends VanComponent {}
|
export class CellSwipe extends VanComponent {}
|
||||||
export class Checkbox extends VanComponent {}
|
export class Checkbox extends VanComponent {}
|
||||||
export class CheckboxGroup extends VanComponent {}
|
export class CheckboxGroup extends VanComponent {}
|
||||||
|
export class Circle extends VanComponent {}
|
||||||
export class Col extends VanComponent {}
|
export class Col extends VanComponent {}
|
||||||
export class Collapse extends VanComponent {}
|
export class Collapse extends VanComponent {}
|
||||||
export class CollapseItem extends VanComponent {}
|
export class CollapseItem extends VanComponent {}
|
||||||
@ -49,9 +51,11 @@ export class Progress extends VanComponent {}
|
|||||||
export class PullRefresh extends VanComponent {}
|
export class PullRefresh extends VanComponent {}
|
||||||
export class Radio extends VanComponent {}
|
export class Radio extends VanComponent {}
|
||||||
export class RadioGroup extends VanComponent {}
|
export class RadioGroup extends VanComponent {}
|
||||||
|
export class Rate extends VanComponent {}
|
||||||
export class Row extends VanComponent {}
|
export class Row extends VanComponent {}
|
||||||
export class Search extends VanComponent {}
|
export class Search extends VanComponent {}
|
||||||
export class Sku extends VanComponent {}
|
export class Sku extends VanComponent {}
|
||||||
|
export class Slider extends VanComponent {}
|
||||||
export class Step extends VanComponent {}
|
export class Step extends VanComponent {}
|
||||||
export class Stepper extends VanComponent {}
|
export class Stepper extends VanComponent {}
|
||||||
export class Steps extends VanComponent {}
|
export class Steps extends VanComponent {}
|
||||||
@ -70,6 +74,7 @@ export class Uploader extends VanComponent {}
|
|||||||
export {
|
export {
|
||||||
Toast,
|
Toast,
|
||||||
Dialog,
|
Dialog,
|
||||||
|
Locale,
|
||||||
Lazyload,
|
Lazyload,
|
||||||
Waterfall,
|
Waterfall,
|
||||||
ImagePreview
|
ImagePreview
|
||||||
|
7
types/locale.d.ts
vendored
Normal file
7
types/locale.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export interface Locale {
|
||||||
|
install(): void;
|
||||||
|
use(lang: string, messages: Object): void;
|
||||||
|
add(messages: Object): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Locale: Locale;
|
4
types/toast.d.ts
vendored
4
types/toast.d.ts
vendored
@ -13,6 +13,10 @@ export interface Toast {
|
|||||||
success(options?: ToastOptions): void;
|
success(options?: ToastOptions): void;
|
||||||
fail(options?: ToastOptions): void;
|
fail(options?: ToastOptions): void;
|
||||||
clear(): void;
|
clear(): void;
|
||||||
|
install(): void;
|
||||||
|
setDefaultOptions(options: ToastOptions): void;
|
||||||
|
resetDefaultOptions(): void;
|
||||||
|
allowMultiple(allow: boolean): void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'vue/types/vue' {
|
declare module 'vue/types/vue' {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user