goods default spec 8.14
This commit is contained in:
@@ -54,12 +54,30 @@ export default {
|
||||
select: 0
|
||||
}
|
||||
},
|
||||
props:['item','title'],
|
||||
watch:{
|
||||
props:['item','title', 'default'],
|
||||
watch: {
|
||||
select(){
|
||||
// console.log(this.select)
|
||||
this.$emit("sel", this.select);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.setDefaultValue();
|
||||
},
|
||||
methods: {
|
||||
setDefaultValue() {
|
||||
for (const ikey in this.item) {
|
||||
if (this.item.hasOwnProperty(ikey)) {
|
||||
const ielement = this.item[ikey];
|
||||
for (const dkey in this.default) {
|
||||
if (this.default.hasOwnProperty(dkey)) {
|
||||
const delement = this.default[dkey];
|
||||
if(ikey == dkey) this.select = ikey;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user