Compare commits

..

No commits in common. "5eb03eea65202b31695a5003b10c36d5d41d6cec" and "1a01c0eae8dd0df0aa6d7bde1c3a061e2e1d21ed" have entirely different histories.

536 changed files with 5128 additions and 33281 deletions

View File

@ -1,11 +1,9 @@
const fs = require('fs');
const gulp = require('gulp');
const path = require('path');
const less = require('gulp-less');
const insert = require('gulp-insert');
const rename = require('gulp-rename');
const postcss = require('gulp-postcss');
const ts = require('gulp-typescript');
const util = require('util');
const exec = util.promisify(require('child_process').exec);
@ -18,10 +16,8 @@ const exampleConfig = path.resolve(__dirname, '../tsconfig.example.json');
const libDir = path.resolve(__dirname, '../lib');
const esDir = path.resolve(__dirname, '../dist');
const exampleDistDir = path.resolve(__dirname, '../example/dist');
const examplePagesDir = path.resolve(__dirname, '../example/pages');
const exampleDir = path.resolve(__dirname, '../example/dist');
const exampleAppJsonPath = path.resolve(__dirname, '../example/app.json');
const baseCssPath = path.resolve(__dirname, '../packages/common/index.wxss');
const lessCompiler = (dist) =>
@ -53,27 +49,9 @@ const lessCompiler = (dist) =>
};
const tsCompiler = (dist, config) =>
function compileTs() {
const tsProject = ts.createProject(config);
return tsProject
.src()
.pipe(tsProject())
.js.pipe(
insert.transform((contents, file) => {
if (dist === exampleDistDir && file.path.includes('/demo/')) {
const iconConfig = '@vant/icons/src/config';
contents = contents.replace(
iconConfig,
path.relative(
path.dirname(file.path),
`${exampleDistDir}/${iconConfig}`
)
);
}
return contents;
})
)
.pipe(gulp.dest(dist));
async function compileTs() {
await exec(`npx tsc -p ${config}`);
await exec(`npx tscpaths -p ${config} -s ../packages -o ${dist}`);
};
const copier = (dist, ext) =>
@ -123,47 +101,18 @@ const tasks = [
}, {});
tasks.buildExample = gulp.series(
cleaner(exampleDistDir),
cleaner(exampleDir),
gulp.parallel(
tsCompiler(exampleDistDir, exampleConfig),
lessCompiler(exampleDistDir),
staticCopier(exampleDistDir),
tsCompiler(exampleDir, exampleConfig),
lessCompiler(exampleDir),
staticCopier(exampleDir),
() =>
gulp
.src(`${icons}/**/*`)
.pipe(gulp.dest(`${exampleDistDir}/@vant/icons`)),
gulp.src(`${icons}/**/*`).pipe(gulp.dest(`${exampleDir}/@vant/icons`)),
() => {
const appJson = JSON.parse(fs.readFileSync(exampleAppJsonPath));
appJson.pages.forEach((path) => {
const component = path.replace(/(pages\/|\/index)/g, '');
const writeFiles = [
{
path: `${examplePagesDir}/${component}/index.js`,
contents: "import Page from '../../common/page';\n\nPage();",
},
{
path: `${examplePagesDir}/${component}/index.wxml`,
contents: `<van-${component}-demo />`,
},
];
writeFiles.forEach((writeFile) => {
fs.access(writeFile.path, fs.constants.F_OK, (fileNotExists) => {
if (fileNotExists) {
fs.writeFile(writeFile.path, writeFile.contents, (err) => {
if (err) {
throw err;
}
});
}
});
});
});
},
() => {
gulp.watch(`${src}/**/*.less`, lessCompiler(exampleDistDir));
gulp.watch(`${src}/**/*.wxml`, copier(exampleDistDir, 'wxml'));
gulp.watch(`${src}/**/*.wxs`, copier(exampleDistDir, 'wxs'));
gulp.watch(`${src}/**/*.json`, copier(exampleDistDir, 'json'));
gulp.watch(`${src}/**/*.less`, lessCompiler(exampleDir));
gulp.watch(`${src}/**/*.wxml`, copier(exampleDir, 'wxml'));
gulp.watch(`${src}/**/*.wxs`, copier(exampleDir, 'wxs'));
gulp.watch(`${src}/**/*.json`, copier(exampleDir, 'json'));
}
)
);

1
dist/action-sheet/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/area/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/button/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1,6 @@
export interface Day {
date: Date;
type: string;
text: number;
bottomInfo?: string;
}

1
dist/calendar/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

View File

@ -6,7 +6,6 @@ function getMonths(minDate, maxDate) {
var cursor = getDate(minDate);
cursor.setDate(1);
cursor.setMinutes(cursor.getMinutes() - cursor.getTimezoneOffset());
do {
months.push(cursor.getTime());

12
dist/calendar/utils.d.ts vendored Normal file
View File

@ -0,0 +1,12 @@
export declare const ROW_HEIGHT = 64;
export declare function formatMonthTitle(date: Date): string;
export declare function compareMonth(date1: Date | number, date2: Date | number): 1 | -1 | 0;
export declare function compareDay(day1: Date | number, day2: Date | number): 1 | -1 | 0;
export declare function getDayByOffset(date: Date, offset: number): Date;
export declare function getPrevDay(date: Date): Date;
export declare function getNextDay(date: Date): Date;
export declare function getToday(): Date;
export declare function calcDateNum(date: [Date, Date]): number;
export declare function copyDates(dates: Date | Date[]): Date | Date[];
export declare function getMonthEndDay(year: number, month: number): number;
export declare function getMonths(minDate: number, maxDate: number): number[];

1
dist/card/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/cell-group/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/cell/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/checkbox-group/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/checkbox/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

4
dist/circle/canvas.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
/// <reference types="miniprogram-api-typings" />
declare type CanvasContext = WechatMiniprogram.CanvasContext;
export declare function adaptor(ctx: CanvasContext & Record<string, unknown>): CanvasContext;
export {};

1
dist/circle/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/col/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

2
dist/collapse-item/animate.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
/// <reference types="miniprogram-api-typings" />
export declare function setContentAnimate(context: WechatMiniprogram.Component.TrivialInstance, expanded: boolean, mounted: boolean): void;

1
dist/collapse-item/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/collapse/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

7
dist/common/color.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
export declare const RED = "#ee0a24";
export declare const BLUE = "#1989fa";
export declare const WHITE = "#fff";
export declare const GREEN = "#07c160";
export declare const ORANGE = "#ff976a";
export declare const GRAY = "#323233";
export declare const GRAY_DARK = "#969799";

4
dist/common/component.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
/// <reference types="miniprogram-api-typings" />
import { VantComponentOptions } from '../definitions/index';
declare function VantComponent<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption>(vantOptions: VantComponentOptions<Data, Props, Methods>): void;
export { VantComponent };

15
dist/common/relation.d.ts vendored Normal file
View File

@ -0,0 +1,15 @@
/// <reference types="miniprogram-api-typings" />
declare type TrivialInstance = WechatMiniprogram.Component.TrivialInstance;
export declare function useParent(name: string, onEffect?: (this: TrivialInstance) => void): {
relations: {
[x: string]: WechatMiniprogram.Component.RelationOption;
};
mixin: string;
};
export declare function useChildren(name: string, onEffect?: (this: TrivialInstance, target: TrivialInstance) => void): {
relations: {
[x: string]: WechatMiniprogram.Component.RelationOption;
};
mixin: string;
};
export {};

13
dist/common/utils.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
/// <reference types="miniprogram-api-typings" />
export { isDef } from './validator';
export declare function range(num: number, min: number, max: number): number;
export declare function nextTick(cb: (...args: any[]) => void): void;
export declare function getSystemInfoSync(): WechatMiniprogram.SystemInfo;
export declare function addUnit(value?: string | number): string | undefined;
export declare function requestAnimationFrame(cb: () => void): number | WechatMiniprogram.NodesRef;
export declare function pickExclude(obj: unknown, keys: string[]): {};
export declare function getRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult>;
export declare function getAllRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult[]>;
export declare function groupSetData(context: WechatMiniprogram.Component.TrivialInstance, cb: () => void): void;
export declare function toPromise(promiseLike: Promise<unknown> | unknown): Promise<unknown>;
export declare function getCurrentPage<T>(): T & WechatMiniprogram.OptionalInterface<WechatMiniprogram.Page.ILifetime> & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods<WechatMiniprogram.IAnyObject> & WechatMiniprogram.Page.Data<WechatMiniprogram.IAnyObject> & WechatMiniprogram.IAnyObject;

9
dist/common/validator.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
export declare function isFunction(val: unknown): val is Function;
export declare function isPlainObject(val: unknown): val is Record<string, unknown>;
export declare function isPromise<T = unknown>(val: unknown): val is Promise<T>;
export declare function isDef(value: unknown): boolean;
export declare function isObj(x: unknown): x is Record<string, unknown>;
export declare function isNumber(value: string): boolean;
export declare function isBoolean(value: unknown): value is boolean;
export declare function isImageUrl(url: string): boolean;
export declare function isVideoUrl(url: string): boolean;

7
dist/common/version.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
export declare function canIUseModel(): boolean;
export declare function canIUseFormFieldButton(): boolean;
export declare function canIUseAnimate(): boolean;
export declare function canIUseGroupSetData(): boolean;
export declare function canIUseNextTick(): boolean;
export declare function canIUseCanvas2d(): boolean;
export declare function canIUseGetUserProfile(): boolean;

1
dist/config-provider/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/count-down/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

10
dist/count-down/utils.d.ts vendored Normal file
View File

@ -0,0 +1,10 @@
export declare type TimeData = {
days: number;
hours: number;
minutes: number;
seconds: number;
milliseconds: number;
};
export declare function parseTimeData(time: number): TimeData;
export declare function parseFormat(format: string, timeData: TimeData): string;
export declare function isSameSecond(time1: number, time2: number): boolean;

1
dist/datetime-picker/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

27
dist/definitions/index.d.ts vendored Normal file
View File

@ -0,0 +1,27 @@
/// <reference types="miniprogram-api-typings" />
interface VantComponentInstance {
parent: WechatMiniprogram.Component.TrivialInstance;
children: WechatMiniprogram.Component.TrivialInstance[];
index: number;
$emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void;
}
export declare type VantComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption> = {
data?: Data;
field?: boolean;
classes?: string[];
mixins?: string[];
props?: Props;
relation?: {
relations: Record<string, WechatMiniprogram.Component.RelationOption>;
mixin: string;
};
methods?: Methods;
beforeCreate?: () => void;
created?: () => void;
mounted?: () => void;
destroyed?: () => void;
} & ThisType<VantComponentInstance & WechatMiniprogram.Component.Instance<Data & {
name: string;
value: any;
} & Record<string, any>, Props, Methods> & Record<string, any>>;
export {};

50
dist/dialog/dialog.d.ts vendored Normal file
View File

@ -0,0 +1,50 @@
/// <reference types="miniprogram-api-typings" />
export declare type Action = 'confirm' | 'cancel' | 'overlay';
interface DialogOptions {
lang?: string;
show?: boolean;
title?: string;
width?: string | number | null;
zIndex?: number;
theme?: string;
context?: WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
message?: string;
overlay?: boolean;
selector?: string;
ariaLabel?: string;
className?: string;
customStyle?: string;
transition?: string;
/**
* @deprecated use beforeClose instead
*/
asyncClose?: boolean;
beforeClose?: null | ((action: Action) => Promise<void> | void);
businessId?: number;
sessionFrom?: string;
overlayStyle?: string;
appParameter?: string;
messageAlign?: string;
sendMessageImg?: string;
showMessageCard?: boolean;
sendMessagePath?: string;
sendMessageTitle?: string;
confirmButtonText?: string;
cancelButtonText?: string;
showConfirmButton?: boolean;
showCancelButton?: boolean;
closeOnClickOverlay?: boolean;
confirmButtonOpenType?: string;
}
declare const Dialog: {
(options: DialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
alert(options: DialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
confirm(options: DialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
close(): void;
stopLoading(): void;
currentOptions: DialogOptions;
defaultOptions: DialogOptions;
setDefaultOptions(options: DialogOptions): void;
resetDefaultOptions(): void;
};
export default Dialog;

1
dist/dialog/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/divider/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/dropdown-item/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

5
dist/dropdown-item/shared.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
export interface Option {
text: string;
value: string | number;
icon: string;
}

1
dist/dropdown-menu/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/empty/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

View File

@ -12,4 +12,3 @@ function imageUrl(image) {
module.exports = {
imageUrl: imageUrl,
};

1
dist/field/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

4
dist/field/props.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
/// <reference types="miniprogram-api-typings" />
export declare const commonProps: WechatMiniprogram.Component.PropertyOption;
export declare const inputProps: WechatMiniprogram.Component.PropertyOption;
export declare const textareaProps: WechatMiniprogram.Component.PropertyOption;

1
dist/goods-action-button/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/goods-action-icon/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/goods-action/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/grid-item/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/grid/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/icon/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/image/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/index-anchor/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/index-bar/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/info/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/loading/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/mixins/basic.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare const basic: string;

1
dist/mixins/button.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare const button: string;

1
dist/mixins/link.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare const link: string;

5
dist/mixins/page-scroll.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
/// <reference types="miniprogram-api-typings" />
declare type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption;
declare type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void;
export declare const pageScrollMixin: (scroller: Scroller) => string;
export {};

View File

@ -11,9 +11,6 @@ function onPageScroll(event) {
export const pageScrollMixin = (scroller) => Behavior({
attached() {
const page = getCurrentPage();
if (!isDef(page)) {
return;
}
if (Array.isArray(page.vanPageScroller)) {
page.vanPageScroller.push(scroller.bind(this));
}

1
dist/mixins/touch.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare const touch: string;

1
dist/mixins/transition.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare function transition(showDefaultValue: boolean): string;

1
dist/nav-bar/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/notice-bar/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/notify/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

20
dist/notify/notify.d.ts vendored Normal file
View File

@ -0,0 +1,20 @@
interface NotifyOptions {
type?: 'primary' | 'success' | 'danger' | 'warning';
color?: string;
zIndex?: number;
top?: number;
message: string;
context?: any;
duration?: number;
selector?: string;
background?: string;
safeAreaInsetTop?: boolean;
onClick?: () => void;
onOpened?: () => void;
onClose?: () => void;
}
declare function Notify(options: NotifyOptions | string): any;
declare namespace Notify {
var clear: (options?: NotifyOptions | undefined) => void;
}
export default Notify;

1
dist/overlay/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/panel/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/picker-column/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/picker/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

21
dist/picker/shared.d.ts vendored Normal file
View File

@ -0,0 +1,21 @@
export declare const pickerProps: {
title: StringConstructor;
loading: BooleanConstructor;
showToolbar: BooleanConstructor;
cancelButtonText: {
type: StringConstructor;
value: string;
};
confirmButtonText: {
type: StringConstructor;
value: string;
};
visibleItemCount: {
type: NumberConstructor;
value: number;
};
itemHeight: {
type: NumberConstructor;
value: number;
};
};

1
dist/popup/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/progress/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/radio-group/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/radio/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/rate/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/row/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/search/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/share-sheet/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/share-sheet/options.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/sidebar-item/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/sidebar/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/skeleton/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/slider/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/stepper/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

View File

@ -61,7 +61,6 @@ VantComponent({
value: true,
},
theme: String,
alwaysEmbed: Boolean,
},
data: {
currentValue: '',

View File

@ -16,14 +16,12 @@
<slot name="minus" />
</view>
<input
always-embed="{{ false }}"
type="{{ integer ? 'number' : 'digit' }}"
class="input-class {{ utils.bem('stepper__input', { disabled: disabled || disableInput }) }}"
style="{{ computed.inputStyle({ buttonSize, inputWidth }) }}"
value="{{ currentValue }}"
focus="{{ focus }}"
disabled="{{ disabled || disableInput }}"
always-embed="{{ alwaysEmbed }}"
bindinput="onInput"
bind:focus="onFocus"
bind:blur="onBlur"

1
dist/steps/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/sticky/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/submit-bar/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/swipe-cell/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/switch/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

View File

@ -3,13 +3,13 @@
<view
class="{{ utils.bem('switch', { on: checked === activeValue, disabled }) }} custom-class"
style="{{ computed.rootStyle({ size, checked, activeColor, inactiveColor, activeValue }) }}"
style="{{ computed.rootStyle({ size, checked, activeColor, inactiveColor }) }}"
bind:tap="onClick"
>
<view class="van-switch__node node-class">
<van-loading
wx:if="{{ loading }}"
color="{{ computed.loadingColor({ checked, activeColor, inactiveColor, activeValue }) }}"
color="{{ computed.loadingColor({ checked, activeColor, inactiveColor }) }}"
custom-class="van-switch__loading"
/>
</view>

View File

@ -3,7 +3,7 @@ var style = require('../wxs/style.wxs');
var addUnit = require('../wxs/add-unit.wxs');
function rootStyle(data) {
var currentColor = data.checked === data.activeValue ? data.activeColor : data.inactiveColor;
var currentColor = data.checked ? data.activeColor : data.inactiveColor;
return style({
'font-size': addUnit(data.size),
@ -15,7 +15,7 @@ var BLUE = '#1989fa';
var GRAY_DARK = '#969799';
function loadingColor(data) {
return data.checked === data.activeValue
return data.checked
? data.activeColor || BLUE
: data.inactiveColor || GRAY_DARK;
}

1
dist/tab/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/tabbar-item/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/tabbar/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/tabs/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/tag/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

1
dist/toast/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

View File

@ -10,7 +10,7 @@
custom-class="van-toast__container"
>
<view
class="van-toast van-toast--{{ (type === 'text' || type === 'html') ? 'text' : 'icon' }} van-toast--{{ position }}"
class="van-toast van-toast--{{ type === 'icon' ? 'icon' : 'text' }} van-toast--{{ position }}"
catch:touchmove="noop"
>
<!-- text only -->

26
dist/toast/toast.d.ts vendored Normal file
View File

@ -0,0 +1,26 @@
/// <reference types="miniprogram-api-typings" />
declare type ToastMessage = string | number;
interface ToastOptions {
show?: boolean;
type?: string;
mask?: boolean;
zIndex?: number;
context?: WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance;
position?: string;
duration?: number;
selector?: string;
forbidClick?: boolean;
loadingType?: string;
message?: ToastMessage;
onClose?: () => void;
}
declare function Toast(toastOptions: ToastOptions | ToastMessage): WechatMiniprogram.Component.TrivialInstance | undefined;
declare namespace Toast {
var loading: (options: ToastMessage | ToastOptions) => WechatMiniprogram.Component.TrivialInstance | undefined;
var success: (options: ToastMessage | ToastOptions) => WechatMiniprogram.Component.TrivialInstance | undefined;
var fail: (options: ToastMessage | ToastOptions) => WechatMiniprogram.Component.TrivialInstance | undefined;
var clear: () => void;
var setDefaultOptions: (options: ToastOptions) => void;
var resetDefaultOptions: () => void;
}
export default Toast;

1
dist/transition/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

Some files were not shown because too many files have changed in this diff Show More