获取焦点优化

This commit is contained in:
2024-05-13 17:09:27 +08:00
parent b0b6916585
commit d2736c625d
8 changed files with 33 additions and 11 deletions

View File

@@ -9,7 +9,7 @@
</view>
<view class="filter_input_wraper">
<!-- <search-box v-model="val1" :focused="true" @handleChange="handleChange1" -->
<search-box v-model="val1" :focused="focusedStatus" @handleChange="handleChange1"
<search-box ref="scanChild" v-model="val1" @handleChange="handleChange1"
/>
</view>
</view>
@@ -77,7 +77,6 @@
},
data() {
return {
focusedStatus: true,
val1: '',
val2: '',
billCode: '',
@@ -90,6 +89,9 @@
this.billCode = option.billcode
this._virtualivtQuery()
},
mounted () {
this.$refs.scanChild.handleFocus()
},
methods: {
handleChange1 (e) {
this._virtualivtQuery()
@@ -109,7 +111,6 @@
this.net_weight_num = res.net_weight_num
},
async _virtualoutConfirm () {
this.focusedStatus = false
if (!this.dataList.length) {
return
}
@@ -124,7 +125,7 @@
title: res.message,
icon: 'none'
})
this.focusedStatus = true
this.$refs.scanChild.handleFocus()
} catch (e) {
this.disabled1 = false
}