下拉框,仅tab切换不确认,记录数据

szh_zidingyibiaoti
lilu 2 years ago
parent 70999ebc86
commit 4da08c09a5

@ -115,7 +115,7 @@ export default {
},
value (nval, oval) {
if (nval !== oval) {
console.log('=== 6. select 修改 - value变化 ===', nval, oval)
this.handleValueChange(nval)
}
}
},
@ -308,8 +308,23 @@ export default {
return option.componentOptions.children[1].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
},
handleValueChange(val) {
this.inEdit = true
setTimeout(() => {
this.inEdit = false
}, 800)
this.selectList.map((item, index) => {
if (`${item[this.showLabel[0]]}${index}` === val) {
this.value = item[this.showLabel[0]]
this.$emit('change', {
type: this.type,
res: this.selectList[index]
})
}
})
},
handleChange (op) {
console.log('=== 1. select 修改 - change ===', op)
// this.selectOpen = !this.selectOpen
this.inEdit = true
setTimeout(() => {
@ -366,7 +381,6 @@ export default {
},
handleSearch (e) {
// console.log('=== 2. select - search ===', e)
if (this.openSearch) {
this.inEdit = true
setTimeout(() => {
@ -403,7 +417,6 @@ export default {
},
openSelect() {
// console.log('=== 3. select - openSelect ===', this.value)
if (!this.open) {
this.getSelectFirst('', false)
} else {
@ -411,11 +424,9 @@ export default {
}
},
selectOption() {
// console.log('=== 4. select - selectOption ===', this.value)
this.open = false
},
getSelectBlur (e) {
// console.log('=== 5. select - getSelectBlur ===', e, this.defaultVal, this.value)
this.open = false
}
}

Loading…
Cancel
Save