goods default spec 8.14

This commit is contained in:
2020-08-14 15:46:43 +08:00
parent 899b93fc4f
commit b266c9c775
3 changed files with 40 additions and 23 deletions

View File

@@ -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>