diff --git a/dist/calendar/calendar.wxml b/dist/calendar/calendar.wxml
index 808f739e..2ba6f303 100644
--- a/dist/calendar/calendar.wxml
+++ b/dist/calendar/calendar.wxml
@@ -54,12 +54,12 @@
type="danger"
color="{{ color }}"
custom-class="van-calendar__confirm"
- disabled="{{ computed.getButtonDisabled(type, currentDate) }}"
+ disabled="{{ computed.getButtonDisabled(type, currentDate, minRange) }}"
nativeType="text"
bind:click="onConfirm"
>
{{
- computed.getButtonDisabled(type, currentDate)
+ computed.getButtonDisabled(type, currentDate, minRange)
? confirmDisabledText
: confirmText
}}
diff --git a/dist/calendar/index.js b/dist/calendar/index.js
index 3b41265c..0c529eff 100644
--- a/dist/calendar/index.js
+++ b/dist/calendar/index.js
@@ -103,6 +103,10 @@ VantComponent({
type: null,
value: null,
},
+ minRange: {
+ type: Number,
+ value: 1,
+ },
firstDayOfWeek: {
type: Number,
value: 0,
diff --git a/dist/calendar/index.wxs b/dist/calendar/index.wxs
index 2c04be10..0a56646e 100644
--- a/dist/calendar/index.wxs
+++ b/dist/calendar/index.wxs
@@ -15,7 +15,7 @@ function getMonths(minDate, maxDate) {
return months;
}
-function getButtonDisabled(type, currentDate) {
+function getButtonDisabled(type, currentDate, minRange) {
if (currentDate == null) {
return true;
}
@@ -25,7 +25,7 @@ function getButtonDisabled(type, currentDate) {
}
if (type === 'multiple') {
- return !currentDate.length;
+ return currentDate.length < minRange;
}
return !currentDate;
diff --git a/dist/cascader/index.js b/dist/cascader/index.js
index a7eeec17..486928a1 100644
--- a/dist/cascader/index.js
+++ b/dist/cascader/index.js
@@ -157,6 +157,9 @@ VantComponent({
onClickTab(e) {
const { index: tabIndex, title } = e.detail;
this.$emit('click-tab', { title, tabIndex });
+ this.setData({
+ activeTab: tabIndex,
+ });
},
// 选中
onSelect(e) {
diff --git a/dist/circle/canvas.d.ts b/dist/circle/canvas.d.ts
index 15268c9f..8a0b71e8 100644
--- a/dist/circle/canvas.d.ts
+++ b/dist/circle/canvas.d.ts
@@ -1,4 +1,4 @@
///
-declare type CanvasContext = WechatMiniprogram.CanvasContext;
+type CanvasContext = WechatMiniprogram.CanvasContext;
export declare function adaptor(ctx: CanvasContext & Record): CanvasContext;
export {};
diff --git a/dist/common/relation.d.ts b/dist/common/relation.d.ts
index 4b5af008..10193fa1 100644
--- a/dist/common/relation.d.ts
+++ b/dist/common/relation.d.ts
@@ -1,5 +1,5 @@
///
-declare type TrivialInstance = WechatMiniprogram.Component.TrivialInstance;
+type TrivialInstance = WechatMiniprogram.Component.TrivialInstance;
export declare function useParent(name: string, onEffect?: (this: TrivialInstance) => void): {
relations: {
[x: string]: WechatMiniprogram.Component.RelationOption;
diff --git a/dist/count-down/utils.d.ts b/dist/count-down/utils.d.ts
index e4a58ddf..876a6c14 100644
--- a/dist/count-down/utils.d.ts
+++ b/dist/count-down/utils.d.ts
@@ -1,4 +1,4 @@
-export declare type TimeData = {
+export type TimeData = {
days: number;
hours: number;
minutes: number;
diff --git a/dist/definitions/index.d.ts b/dist/definitions/index.d.ts
index c4c98f9c..d0554f62 100644
--- a/dist/definitions/index.d.ts
+++ b/dist/definitions/index.d.ts
@@ -5,7 +5,7 @@ interface VantComponentInstance {
index: number;
$emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void;
}
-export declare type VantComponentOptions = {
+export type VantComponentOptions = {
data?: Data;
field?: boolean;
classes?: string[];
diff --git a/dist/dialog/dialog.d.ts b/dist/dialog/dialog.d.ts
index 17708107..db2da5ff 100644
--- a/dist/dialog/dialog.d.ts
+++ b/dist/dialog/dialog.d.ts
@@ -1,7 +1,7 @@
///
///
-export declare type Action = 'confirm' | 'cancel' | 'overlay';
-declare type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
+export type Action = 'confirm' | 'cancel' | 'overlay';
+type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
interface DialogOptions {
lang?: string;
show?: boolean;
diff --git a/dist/mixins/page-scroll.d.ts b/dist/mixins/page-scroll.d.ts
index 9fab3e2a..46254479 100644
--- a/dist/mixins/page-scroll.d.ts
+++ b/dist/mixins/page-scroll.d.ts
@@ -1,6 +1,6 @@
///
///
-declare type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption;
-declare type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void;
+type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption;
+type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void;
export declare function pageScrollMixin(scroller: Scroller): string;
export {};
diff --git a/dist/popup/index.js b/dist/popup/index.js
index 9c5ef868..29b51b15 100644
--- a/dist/popup/index.js
+++ b/dist/popup/index.js
@@ -53,6 +53,10 @@ VantComponent({
type: Boolean,
value: false,
},
+ safeAreaTabBar: {
+ type: Boolean,
+ value: false,
+ },
lockScroll: {
type: Boolean,
value: true,
diff --git a/dist/popup/index.wxml b/dist/popup/index.wxml
index ea7d696b..fad03082 100644
--- a/dist/popup/index.wxml
+++ b/dist/popup/index.wxml
@@ -12,7 +12,7 @@
/>
///
-declare type ToastMessage = string | number;
-declare type ToastContext = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance;
+type ToastMessage = string | number;
+type ToastContext = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance;
interface ToastOptions {
show?: boolean;
type?: string;
diff --git a/dist/uploader/index.js b/dist/uploader/index.js
index 84cf5e96..007bc38a 100644
--- a/dist/uploader/index.js
+++ b/dist/uploader/index.js
@@ -1,6 +1,6 @@
import { VantComponent } from '../common/component';
import { isImageFile, chooseFile, isVideoFile } from './utils';
-import { chooseImageProps, chooseVideoProps, chooseMediaProps, chooseMessageFileProps, } from './shared';
+import { imageProps, videoProps, mediaProps, messageFileProps } from './shared';
import { isBoolean, isPromise } from '../common/validator';
VantComponent({
props: Object.assign(Object.assign(Object.assign(Object.assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: {
@@ -40,7 +40,7 @@ VantComponent({
}, uploadIcon: {
type: String,
value: 'photograph',
- } }, chooseImageProps), chooseVideoProps), chooseMediaProps), chooseMessageFileProps),
+ } }, imageProps), videoProps), mediaProps), messageFileProps),
data: {
lists: [],
isInCount: true,
@@ -114,11 +114,12 @@ VantComponent({
if (!this.data.previewFullImage)
return;
const { index } = event.currentTarget.dataset;
- const { lists } = this.data;
+ const { lists, showmenu } = this.data;
const item = lists[index];
wx.previewImage({
urls: lists.filter((item) => isImageFile(item)).map((item) => item.url),
current: item.url,
+ showmenu,
fail() {
wx.showToast({ title: '预览图片失败', icon: 'none' });
},
diff --git a/dist/uploader/shared.d.ts b/dist/uploader/shared.d.ts
index 50913eb2..e0a0d7e3 100644
--- a/dist/uploader/shared.d.ts
+++ b/dist/uploader/shared.d.ts
@@ -1,4 +1,4 @@
-export declare const chooseImageProps: {
+export declare const imageProps: {
sizeType: {
type: ArrayConstructor;
value: string[];
@@ -7,8 +7,12 @@ export declare const chooseImageProps: {
type: ArrayConstructor;
value: string[];
};
+ showmenu: {
+ type: BooleanConstructor;
+ value: boolean;
+ };
};
-export declare const chooseVideoProps: {
+export declare const videoProps: {
capture: {
type: ArrayConstructor;
value: string[];
@@ -26,7 +30,7 @@ export declare const chooseVideoProps: {
value: string;
};
};
-export declare const chooseMediaProps: {
+export declare const mediaProps: {
capture: {
type: ArrayConstructor;
value: string[];
@@ -44,6 +48,6 @@ export declare const chooseMediaProps: {
value: string;
};
};
-export declare const chooseMessageFileProps: {
+export declare const messageFileProps: {
extension: null;
};
diff --git a/dist/uploader/shared.js b/dist/uploader/shared.js
index 7866a6d1..3ac6f8a3 100644
--- a/dist/uploader/shared.js
+++ b/dist/uploader/shared.js
@@ -1,5 +1,5 @@
-// props for choose image
-export const chooseImageProps = {
+// props for image
+export const imageProps = {
sizeType: {
type: Array,
value: ['original', 'compressed'],
@@ -8,9 +8,13 @@ export const chooseImageProps = {
type: Array,
value: ['album', 'camera'],
},
+ showmenu: {
+ type: Boolean,
+ value: true,
+ },
};
-// props for choose video
-export const chooseVideoProps = {
+// props for video
+export const videoProps = {
capture: {
type: Array,
value: ['album', 'camera'],
@@ -28,8 +32,8 @@ export const chooseVideoProps = {
value: 'back',
},
};
-// props for choose media
-export const chooseMediaProps = {
+// props for media
+export const mediaProps = {
capture: {
type: Array,
value: ['album', 'camera'],
@@ -47,7 +51,7 @@ export const chooseMediaProps = {
value: 'back',
},
};
-// props for choose file
-export const chooseMessageFileProps = {
+// props for file
+export const messageFileProps = {
extension: null,
};
diff --git a/lib/calendar/calendar.wxml b/lib/calendar/calendar.wxml
index 808f739e..2ba6f303 100644
--- a/lib/calendar/calendar.wxml
+++ b/lib/calendar/calendar.wxml
@@ -54,12 +54,12 @@
type="danger"
color="{{ color }}"
custom-class="van-calendar__confirm"
- disabled="{{ computed.getButtonDisabled(type, currentDate) }}"
+ disabled="{{ computed.getButtonDisabled(type, currentDate, minRange) }}"
nativeType="text"
bind:click="onConfirm"
>
{{
- computed.getButtonDisabled(type, currentDate)
+ computed.getButtonDisabled(type, currentDate, minRange)
? confirmDisabledText
: confirmText
}}
diff --git a/lib/calendar/index.js b/lib/calendar/index.js
index 3baa5f0b..b5926774 100644
--- a/lib/calendar/index.js
+++ b/lib/calendar/index.js
@@ -119,6 +119,10 @@ var getTime = function (date) {
type: null,
value: null,
},
+ minRange: {
+ type: Number,
+ value: 1,
+ },
firstDayOfWeek: {
type: Number,
value: 0,
diff --git a/lib/calendar/index.wxs b/lib/calendar/index.wxs
index 2c04be10..0a56646e 100644
--- a/lib/calendar/index.wxs
+++ b/lib/calendar/index.wxs
@@ -15,7 +15,7 @@ function getMonths(minDate, maxDate) {
return months;
}
-function getButtonDisabled(type, currentDate) {
+function getButtonDisabled(type, currentDate, minRange) {
if (currentDate == null) {
return true;
}
@@ -25,7 +25,7 @@ function getButtonDisabled(type, currentDate) {
}
if (type === 'multiple') {
- return !currentDate.length;
+ return currentDate.length < minRange;
}
return !currentDate;
diff --git a/lib/cascader/index.js b/lib/cascader/index.js
index a3662ba1..1eedfe95 100644
--- a/lib/cascader/index.js
+++ b/lib/cascader/index.js
@@ -171,6 +171,9 @@ var defaultFieldNames = {
onClickTab: function (e) {
var _a = e.detail, tabIndex = _a.index, title = _a.title;
this.$emit('click-tab', { title: title, tabIndex: tabIndex });
+ this.setData({
+ activeTab: tabIndex,
+ });
},
// 选中
onSelect: function (e) {
diff --git a/lib/circle/canvas.d.ts b/lib/circle/canvas.d.ts
index 15268c9f..8a0b71e8 100644
--- a/lib/circle/canvas.d.ts
+++ b/lib/circle/canvas.d.ts
@@ -1,4 +1,4 @@
///
-declare type CanvasContext = WechatMiniprogram.CanvasContext;
+type CanvasContext = WechatMiniprogram.CanvasContext;
export declare function adaptor(ctx: CanvasContext & Record): CanvasContext;
export {};
diff --git a/lib/common/relation.d.ts b/lib/common/relation.d.ts
index 4b5af008..10193fa1 100644
--- a/lib/common/relation.d.ts
+++ b/lib/common/relation.d.ts
@@ -1,5 +1,5 @@
///
-declare type TrivialInstance = WechatMiniprogram.Component.TrivialInstance;
+type TrivialInstance = WechatMiniprogram.Component.TrivialInstance;
export declare function useParent(name: string, onEffect?: (this: TrivialInstance) => void): {
relations: {
[x: string]: WechatMiniprogram.Component.RelationOption;
diff --git a/lib/count-down/utils.d.ts b/lib/count-down/utils.d.ts
index e4a58ddf..876a6c14 100644
--- a/lib/count-down/utils.d.ts
+++ b/lib/count-down/utils.d.ts
@@ -1,4 +1,4 @@
-export declare type TimeData = {
+export type TimeData = {
days: number;
hours: number;
minutes: number;
diff --git a/lib/definitions/index.d.ts b/lib/definitions/index.d.ts
index c4c98f9c..d0554f62 100644
--- a/lib/definitions/index.d.ts
+++ b/lib/definitions/index.d.ts
@@ -5,7 +5,7 @@ interface VantComponentInstance {
index: number;
$emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void;
}
-export declare type VantComponentOptions = {
+export type VantComponentOptions = {
data?: Data;
field?: boolean;
classes?: string[];
diff --git a/lib/dialog/dialog.d.ts b/lib/dialog/dialog.d.ts
index 17708107..db2da5ff 100644
--- a/lib/dialog/dialog.d.ts
+++ b/lib/dialog/dialog.d.ts
@@ -1,7 +1,7 @@
///
///
-export declare type Action = 'confirm' | 'cancel' | 'overlay';
-declare type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
+export type Action = 'confirm' | 'cancel' | 'overlay';
+type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
interface DialogOptions {
lang?: string;
show?: boolean;
diff --git a/lib/mixins/page-scroll.d.ts b/lib/mixins/page-scroll.d.ts
index 9fab3e2a..46254479 100644
--- a/lib/mixins/page-scroll.d.ts
+++ b/lib/mixins/page-scroll.d.ts
@@ -1,6 +1,6 @@
///
///
-declare type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption;
-declare type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void;
+type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption;
+type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void;
export declare function pageScrollMixin(scroller: Scroller): string;
export {};
diff --git a/lib/popup/index.js b/lib/popup/index.js
index 56367a45..9cbbad8e 100644
--- a/lib/popup/index.js
+++ b/lib/popup/index.js
@@ -55,6 +55,10 @@ var transition_1 = require("../mixins/transition");
type: Boolean,
value: false,
},
+ safeAreaTabBar: {
+ type: Boolean,
+ value: false,
+ },
lockScroll: {
type: Boolean,
value: true,
diff --git a/lib/popup/index.wxml b/lib/popup/index.wxml
index ea7d696b..fad03082 100644
--- a/lib/popup/index.wxml
+++ b/lib/popup/index.wxml
@@ -12,7 +12,7 @@
/>
///
-declare type ToastMessage = string | number;
-declare type ToastContext = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance;
+type ToastMessage = string | number;
+type ToastContext = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance;
interface ToastOptions {
show?: boolean;
type?: string;
diff --git a/lib/uploader/index.js b/lib/uploader/index.js
index 7eff33c3..69b40617 100644
--- a/lib/uploader/index.js
+++ b/lib/uploader/index.js
@@ -53,7 +53,7 @@ var validator_1 = require("../common/validator");
}, uploadIcon: {
type: String,
value: 'photograph',
- } }, shared_1.chooseImageProps), shared_1.chooseVideoProps), shared_1.chooseMediaProps), shared_1.chooseMessageFileProps),
+ } }, shared_1.imageProps), shared_1.videoProps), shared_1.mediaProps), shared_1.messageFileProps),
data: {
lists: [],
isInCount: true,
@@ -129,11 +129,12 @@ var validator_1 = require("../common/validator");
if (!this.data.previewFullImage)
return;
var index = event.currentTarget.dataset.index;
- var lists = this.data.lists;
+ var _a = this.data, lists = _a.lists, showmenu = _a.showmenu;
var item = lists[index];
wx.previewImage({
urls: lists.filter(function (item) { return (0, utils_1.isImageFile)(item); }).map(function (item) { return item.url; }),
current: item.url,
+ showmenu: showmenu,
fail: function () {
wx.showToast({ title: '预览图片失败', icon: 'none' });
},
diff --git a/lib/uploader/shared.d.ts b/lib/uploader/shared.d.ts
index 50913eb2..e0a0d7e3 100644
--- a/lib/uploader/shared.d.ts
+++ b/lib/uploader/shared.d.ts
@@ -1,4 +1,4 @@
-export declare const chooseImageProps: {
+export declare const imageProps: {
sizeType: {
type: ArrayConstructor;
value: string[];
@@ -7,8 +7,12 @@ export declare const chooseImageProps: {
type: ArrayConstructor;
value: string[];
};
+ showmenu: {
+ type: BooleanConstructor;
+ value: boolean;
+ };
};
-export declare const chooseVideoProps: {
+export declare const videoProps: {
capture: {
type: ArrayConstructor;
value: string[];
@@ -26,7 +30,7 @@ export declare const chooseVideoProps: {
value: string;
};
};
-export declare const chooseMediaProps: {
+export declare const mediaProps: {
capture: {
type: ArrayConstructor;
value: string[];
@@ -44,6 +48,6 @@ export declare const chooseMediaProps: {
value: string;
};
};
-export declare const chooseMessageFileProps: {
+export declare const messageFileProps: {
extension: null;
};
diff --git a/lib/uploader/shared.js b/lib/uploader/shared.js
index 5986ebea..4e077271 100644
--- a/lib/uploader/shared.js
+++ b/lib/uploader/shared.js
@@ -1,8 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.chooseMessageFileProps = exports.chooseMediaProps = exports.chooseVideoProps = exports.chooseImageProps = void 0;
-// props for choose image
-exports.chooseImageProps = {
+exports.messageFileProps = exports.mediaProps = exports.videoProps = exports.imageProps = void 0;
+// props for image
+exports.imageProps = {
sizeType: {
type: Array,
value: ['original', 'compressed'],
@@ -11,9 +11,13 @@ exports.chooseImageProps = {
type: Array,
value: ['album', 'camera'],
},
+ showmenu: {
+ type: Boolean,
+ value: true,
+ },
};
-// props for choose video
-exports.chooseVideoProps = {
+// props for video
+exports.videoProps = {
capture: {
type: Array,
value: ['album', 'camera'],
@@ -31,8 +35,8 @@ exports.chooseVideoProps = {
value: 'back',
},
};
-// props for choose media
-exports.chooseMediaProps = {
+// props for media
+exports.mediaProps = {
capture: {
type: Array,
value: ['album', 'camera'],
@@ -50,7 +54,7 @@ exports.chooseMediaProps = {
value: 'back',
},
};
-// props for choose file
-exports.chooseMessageFileProps = {
+// props for file
+exports.messageFileProps = {
extension: null,
};