diff --git a/dist/area/index.js b/dist/area/index.js
index e7fc8a35..d77fcf8e 100644
--- a/dist/area/index.js
+++ b/dist/area/index.js
@@ -165,27 +165,30 @@ VantComponent({
return;
}
const stack = [];
- stack.push(picker.setColumnValues(0, province, false));
- stack.push(picker.setColumnValues(1, city, false));
- if (city.length && code.slice(2, 4) === '00') {
- [{ code }] = city;
+ const indexes = [];
+ if (this.data.columnsNum >= 1) {
+ stack.push(picker.setColumnValues(0, province, false));
+ indexes.push(this.getIndex('province', code));
+ }
+ if (this.data.columnsNum >= 2) {
+ stack.push(picker.setColumnValues(1, city, false));
+ indexes.push(this.getIndex('province', code));
+ if (city.length && code.slice(2, 4) === '00') {
+ [{ code }] = city;
+ }
+ }
+ if (this.data.columnsNum === 3) {
+ stack.push(
+ picker.setColumnValues(
+ 2,
+ this.getList('county', code.slice(0, 4)),
+ false
+ )
+ );
}
- stack.push(
- picker.setColumnValues(
- 2,
- this.getList('county', code.slice(0, 4)),
- false
- )
- );
return Promise.all(stack)
.catch(() => {})
- .then(() =>
- picker.setIndexes([
- this.getIndex('province', code),
- this.getIndex('city', code),
- this.getIndex('county', code),
- ])
- )
+ .then(() => picker.setIndexes(indexes))
.catch(() => {});
},
getValues() {
diff --git a/dist/datetime-picker/index.js b/dist/datetime-picker/index.js
index 3ff8e39e..ef9394d9 100644
--- a/dist/datetime-picker/index.js
+++ b/dist/datetime-picker/index.js
@@ -89,7 +89,7 @@ VantComponent({
methods: {
updateValue() {
const { data } = this;
- const val = this.correctValue(this.data.value);
+ const val = this.correctValue(data.value);
const isEqual = val === data.innerValue;
if (!isEqual) {
this.updateColumnValue(val).then(() => {
@@ -251,12 +251,16 @@ VantComponent({
const { data } = this;
let value;
const picker = this.getPicker();
+ const originColumns = this.getOriginColumns();
if (data.type === 'time') {
const indexes = picker.getIndexes();
- value = `${+data.columns[0].values[indexes[0]]}:${+data.columns[1]
+ value = `${+originColumns[0].values[indexes[0]]}:${+originColumns[1]
.values[indexes[1]]}`;
} else {
- const values = picker.getValues();
+ const indexes = picker.getIndexes();
+ const values = indexes.map(
+ (value, index) => originColumns[index].values[value]
+ );
const year = getTrueValue(values[0]);
const month = getTrueValue(values[1]);
const maxDate = getMonthEndDay(year, month);
@@ -281,7 +285,8 @@ VantComponent({
},
updateColumnValue(value) {
let values = [];
- const { type, formatter = defaultFormatter } = this.data;
+ const { type } = this.data;
+ const formatter = this.data.formatter || defaultFormatter;
const picker = this.getPicker();
if (type === 'time') {
const pair = value.split(':');
diff --git a/dist/empty/index.d.ts b/dist/empty/index.d.ts
new file mode 100644
index 00000000..cb0ff5c3
--- /dev/null
+++ b/dist/empty/index.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/empty/index.js b/dist/empty/index.js
new file mode 100644
index 00000000..0fee8a48
--- /dev/null
+++ b/dist/empty/index.js
@@ -0,0 +1,20 @@
+import { VantComponent } from '../common/component';
+const PRESETS = ['error', 'search', 'default', 'network'];
+VantComponent({
+ props: {
+ description: String,
+ image: {
+ type: String,
+ value: 'default',
+ },
+ },
+ created() {
+ if (PRESETS.indexOf(this.data.image) !== -1) {
+ this.setData({
+ imageUrl: `https://img.yzcdn.cn/vant/empty-image-${this.data.image}.png`,
+ });
+ } else {
+ this.setData({ imageUrl: this.data.image });
+ }
+ },
+});
diff --git a/dist/empty/index.json b/dist/empty/index.json
new file mode 100644
index 00000000..e8cfaaf8
--- /dev/null
+++ b/dist/empty/index.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/dist/empty/index.wxml b/dist/empty/index.wxml
new file mode 100644
index 00000000..1c284697
--- /dev/null
+++ b/dist/empty/index.wxml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+ {{ description }}
+
+
+
+
+
\ No newline at end of file
diff --git a/dist/empty/index.wxss b/dist/empty/index.wxss
new file mode 100644
index 00000000..931518d0
--- /dev/null
+++ b/dist/empty/index.wxss
@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image__img{width:100%;height:100%}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__bottom{margin-top:24px}
\ No newline at end of file
diff --git a/dist/field/index.js b/dist/field/index.js
index 6bfade57..154bda12 100644
--- a/dist/field/index.js
+++ b/dist/field/index.js
@@ -18,16 +18,8 @@ VantComponent({
leftIcon: String,
rightIcon: String,
autosize: [Boolean, Object],
- readonly: {
- type: Boolean,
- observer: 'setShowClear',
- },
required: Boolean,
iconClass: String,
- clearable: {
- type: Boolean,
- observer: 'setShowClear',
- },
clickable: Boolean,
inputAlign: String,
customStyle: String,
@@ -35,13 +27,21 @@ VantComponent({
arrowDirection: String,
showWordLimit: Boolean,
errorMessageAlign: String,
+ readonly: {
+ type: Boolean,
+ observer: 'setShowClear',
+ },
+ clearable: {
+ type: Boolean,
+ observer: 'setShowClear',
+ },
border: {
type: Boolean,
value: true,
},
titleWidth: {
type: String,
- value: '90px',
+ value: '6.2em',
},
}
),
diff --git a/dist/field/index.wxml b/dist/field/index.wxml
index c984d897..5ff36176 100644
--- a/dist/field/index.wxml
+++ b/dist/field/index.wxml
@@ -4,7 +4,6 @@
-
+
+ {{ label }}
+
+