|
|
@@ -92,25 +92,25 @@ export default {
|
|
|
this.chooseValueData = [...this.cacheValueData];
|
|
|
this.$emit('close');
|
|
|
},
|
|
|
-
|
|
|
chooseItem(value, index) {
|
|
|
if (this.cacheValueData[index] !== value) {
|
|
|
this.cacheValueData[index] = value;
|
|
|
this.$emit('choose', this, index, value, this.cacheValueData);
|
|
|
}
|
|
|
+ },
|
|
|
+ init() {
|
|
|
+ if (this.defaultValueData && this.defaultValueData.length) {
|
|
|
+ this.chooseValueData = [...this.defaultValueData];
|
|
|
+ } else {
|
|
|
+ let defaultValueData = [];
|
|
|
+ this.listData.map((item, index) => {
|
|
|
+ defaultValueData.push(item[0]);
|
|
|
+ });
|
|
|
+ this.chooseValueData = [...defaultValueData];
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- init() {
|
|
|
- if (this.defaultValueData && this.defaultValueData.length) {
|
|
|
- this.chooseValueData = [...this.defaultValueData];
|
|
|
- } else {
|
|
|
- let defaultValueData = [];
|
|
|
- this.listData.map((item, index) => {
|
|
|
- defaultValueData.push(item[0]);
|
|
|
- });
|
|
|
- this.chooseValueData = [...defaultValueData];
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
created() {
|
|
|
this.init();
|
|
|
}
|