mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2026-06-06 02:18:11 +08:00
Compare commits
3 Commits
9f79242f48
...
ecff423eb6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ecff423eb6 | ||
|
|
51aff18dea | ||
|
|
f96bc10158 |
11
.github/dependabot.yml
vendored
Normal file
11
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
ignore:
|
||||||
|
- dependency-name: miniprogram-api-typings
|
||||||
|
versions:
|
||||||
|
- 3.3.2
|
||||||
@ -38,7 +38,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/youzan/vant-weapp#readme",
|
"homepage": "https://github.com/youzan/vant-weapp#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vant/cli": "^3.10.0",
|
"@vant/cli": "^3.10.3",
|
||||||
"@vant/icons": "1.5.3",
|
"@vant/icons": "1.5.3",
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
"gulp-insert": "^0.5.0",
|
"gulp-insert": "^0.5.0",
|
||||||
|
|||||||
@ -102,7 +102,7 @@ VantComponent({
|
|||||||
onChange(event: WechatMiniprogram.CustomEvent) {
|
onChange(event: WechatMiniprogram.CustomEvent) {
|
||||||
const { index, picker, value } = event.detail;
|
const { index, picker, value } = event.detail;
|
||||||
this.code = value[index].code;
|
this.code = value[index].code;
|
||||||
this.setValues().then(() => {
|
this.setValues()?.then(() => {
|
||||||
this.$emit('change', {
|
this.$emit('change', {
|
||||||
picker,
|
picker,
|
||||||
values: this.parseValues(picker.getValues()),
|
values: this.parseValues(picker.getValues()),
|
||||||
|
|||||||
@ -10,7 +10,7 @@ interface Day {
|
|||||||
date: Date;
|
date: Date;
|
||||||
type: string;
|
type: string;
|
||||||
text: number;
|
text: number;
|
||||||
bottomInfo: string;
|
bottomInfo?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
VantComponent({
|
VantComponent({
|
||||||
@ -125,13 +125,13 @@ VantComponent({
|
|||||||
getRangeDayType(day) {
|
getRangeDayType(day) {
|
||||||
const { currentDate, allowSameDay } = this.data;
|
const { currentDate, allowSameDay } = this.data;
|
||||||
if (!Array.isArray(currentDate)) {
|
if (!Array.isArray(currentDate)) {
|
||||||
return;
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
const [startDay, endDay] = currentDate;
|
const [startDay, endDay] = currentDate;
|
||||||
|
|
||||||
if (!startDay) {
|
if (!startDay) {
|
||||||
return;
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
const compareToStart = compareDay(day, startDay);
|
const compareToStart = compareDay(day, startDay);
|
||||||
@ -157,6 +157,8 @@ VantComponent({
|
|||||||
if (compareToStart > 0 && compareToEnd < 0) {
|
if (compareToStart > 0 && compareToEnd < 0) {
|
||||||
return 'middle';
|
return 'middle';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
},
|
},
|
||||||
|
|
||||||
getDayType(day) {
|
getDayType(day) {
|
||||||
@ -178,6 +180,8 @@ VantComponent({
|
|||||||
if (type === 'range') {
|
if (type === 'range') {
|
||||||
return this.getRangeDayType(day);
|
return this.getRangeDayType(day);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
},
|
},
|
||||||
|
|
||||||
getBottomInfo(type) {
|
getBottomInfo(type) {
|
||||||
|
|||||||
@ -272,7 +272,7 @@ VantComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
select(date, complete) {
|
select(date, complete?: boolean) {
|
||||||
if (complete && this.data.type === 'range') {
|
if (complete && this.data.type === 'range') {
|
||||||
const valid = this.checkRange(date);
|
const valid = this.checkRange(date);
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,7 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
getContext() {
|
getContext(): Promise<WechatMiniprogram.CanvasContext> {
|
||||||
const { type, size } = this.data;
|
const { type, size } = this.data;
|
||||||
|
|
||||||
if (type === '' || !canIUseCanvas2d()) {
|
if (type === '' || !canIUseCanvas2d()) {
|
||||||
@ -108,7 +108,10 @@ VantComponent({
|
|||||||
Object.keys(color)
|
Object.keys(color)
|
||||||
.sort((a, b) => parseFloat(a) - parseFloat(b))
|
.sort((a, b) => parseFloat(a) - parseFloat(b))
|
||||||
.map((key) =>
|
.map((key) =>
|
||||||
LinearColor.addColorStop(parseFloat(key) / 100, color[key])
|
LinearColor.addColorStop(
|
||||||
|
parseFloat(key) / 100,
|
||||||
|
color[key] as string
|
||||||
|
)
|
||||||
);
|
);
|
||||||
this.hoverColor = LinearColor;
|
this.hoverColor = LinearColor;
|
||||||
});
|
});
|
||||||
@ -118,7 +121,7 @@ VantComponent({
|
|||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
},
|
},
|
||||||
|
|
||||||
presetCanvas(context, strokeStyle, beginAngle, endAngle, fill) {
|
presetCanvas(context, strokeStyle, beginAngle, endAngle, fill?: string) {
|
||||||
const { strokeWidth, lineCap, clockwise, size } = this.data;
|
const { strokeWidth, lineCap, clockwise, size } = this.data;
|
||||||
const position = size / 2;
|
const position = size / 2;
|
||||||
const radius = position - strokeWidth / 2;
|
const radius = position - strokeWidth / 2;
|
||||||
|
|||||||
@ -15,7 +15,7 @@ export function nextTick(cb: (...args: any[]) => void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let systemInfo: WechatMiniprogram.GetSystemInfoSyncResult;
|
let systemInfo: WechatMiniprogram.SystemInfo;
|
||||||
export function getSystemInfoSync() {
|
export function getSystemInfoSync() {
|
||||||
if (systemInfo == null) {
|
if (systemInfo == null) {
|
||||||
systemInfo = wx.getSystemInfoSync();
|
systemInfo = wx.getSystemInfoSync();
|
||||||
|
|||||||
@ -145,9 +145,8 @@ VantComponent({
|
|||||||
const { filter } = this.data;
|
const { filter } = this.data;
|
||||||
const results = this.getRanges().map(({ type, range }) => {
|
const results = this.getRanges().map(({ type, range }) => {
|
||||||
let values = times(range[1] - range[0] + 1, (index) => {
|
let values = times(range[1] - range[0] + 1, (index) => {
|
||||||
let value = range[0] + index;
|
const value = range[0] + index;
|
||||||
value = type === 'year' ? `${value}` : padZero(value);
|
return type === 'year' ? `${value}` : padZero(value);
|
||||||
return value;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (filter) {
|
if (filter) {
|
||||||
|
|||||||
@ -113,7 +113,7 @@ VantComponent({
|
|||||||
: option;
|
: option;
|
||||||
},
|
},
|
||||||
|
|
||||||
setIndex(index: number, userAction: boolean) {
|
setIndex(index: number, userAction?: boolean) {
|
||||||
const { data } = this;
|
const { data } = this;
|
||||||
index = this.adjustIndex(index) || 0;
|
index = this.adjustIndex(index) || 0;
|
||||||
const offset = -index * data.itemHeight;
|
const offset = -index * data.itemHeight;
|
||||||
|
|||||||
@ -89,7 +89,7 @@ VantComponent({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
updateValue(value: number, end: boolean, drag: boolean) {
|
updateValue(value: number, end?: boolean, drag?: boolean) {
|
||||||
value = this.format(value);
|
value = this.format(value);
|
||||||
const { min } = this.data;
|
const { min } = this.data;
|
||||||
const width = `${((value - min) * 100) / this.getRange()}%`;
|
const width = `${((value - min) * 100) / this.getRange()}%`;
|
||||||
|
|||||||
@ -51,7 +51,7 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onScroll({ scrollTop } = {}) {
|
onScroll({ scrollTop }: { scrollTop?: number } = {}) {
|
||||||
const { container, offsetTop, disabled } = this.data;
|
const { container, offsetTop, disabled } = this.data;
|
||||||
|
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
|
|||||||
@ -82,7 +82,7 @@ VantComponent({
|
|||||||
this.setData({ lists, isInCount: lists.length < maxCount });
|
this.setData({ lists, isInCount: lists.length < maxCount });
|
||||||
},
|
},
|
||||||
|
|
||||||
getDetail(index) {
|
getDetail(index?: number) {
|
||||||
return {
|
return {
|
||||||
name: this.data.name,
|
name: this.data.name,
|
||||||
index: index == null ? this.data.fileList.length : index,
|
index: index == null ? this.data.fileList.length : index,
|
||||||
|
|||||||
@ -2978,10 +2978,10 @@
|
|||||||
"@typescript-eslint/types" "4.21.0"
|
"@typescript-eslint/types" "4.21.0"
|
||||||
eslint-visitor-keys "^2.0.0"
|
eslint-visitor-keys "^2.0.0"
|
||||||
|
|
||||||
"@vant/cli@^3.10.0":
|
"@vant/cli@^3.10.3":
|
||||||
version "3.10.2"
|
version "3.10.3"
|
||||||
resolved "https://registry.yarnpkg.com/@vant/cli/-/cli-3.10.2.tgz#b5766a2ab136694543d86d102168ab981acfadff"
|
resolved "https://registry.nlark.com/@vant/cli/download/@vant/cli-3.10.3.tgz?cache=0&sync_timestamp=1619699867594&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40vant%2Fcli%2Fdownload%2F%40vant%2Fcli-3.10.3.tgz#021d9a136e9be81c5aa51da0fe1ef61410460bf6"
|
||||||
integrity sha512-CF118Co5BAfH/DtH6jrqBNG2v9pErIkC7ps7JZhZb1CYTPb5l5xkEq0GwjCmGcL1UtbQO/3GvPROFbpYtoLDVA==
|
integrity sha1-Ah2aE26b6BxapR2g/h72FBBGC/Y=
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/core" "^7.12.10"
|
"@babel/core" "^7.12.10"
|
||||||
"@babel/preset-env" "^7.12.11"
|
"@babel/preset-env" "^7.12.11"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user