no message

This commit is contained in:
蔡玲
2024-10-17 15:34:20 +08:00
parent b86b4d20bc
commit 5afd1bc1db

View File

@@ -8,6 +8,8 @@
ref="input" ref="input"
:placeholder="placeholder" :placeholder="placeholder"
:value="value" :value="value"
:focus="focusState"
:readOnly="readOnly"
@focus="handleFocus" @focus="handleFocus"
@blur="handleBlur" @blur="handleBlur"
@input="handleSend"> @input="handleSend">
@@ -43,7 +45,6 @@ export default {
}, },
methods: { methods: {
handleFocus () { handleFocus () {
this.$refs.input.focus()
this.focusState = true this.focusState = true
}, },
handleBlur (e) { handleBlur (e) {
@@ -55,6 +56,12 @@ export default {
if (e.target.value.length) { if (e.target.value.length) {
this.$emit('handleChange', e.target.value) this.$emit('handleChange', e.target.value)
} }
this.focusState = false
this.readOnly = true
setTimeout(() => {
this.readOnly = false
}, 200)
this.$refs.input.blur()
} }
} }
} }