feat: 输入框组件数据联动添加回车键触发

main
wu.jian2 2 years ago
parent 53e11cdc61
commit c5653f4113

@ -9,13 +9,14 @@
</span>
<el-input
:id="`el-input-${config.code}`"
v-model="config.customize.value"
v-model="value"
type="text"
resize="both"
class="input"
:placeholder="config.customize.placeholderStyle.placeholder"
:style="{ backgroundColor: config.customize.backgroundStyle.backgroundColor }"
@input="handleInput"
@keyup.enter.native="keyupEnter"
>
<i
v-if="config.customize.icon.position === 'left' && config.customize.icon.name"
@ -50,6 +51,7 @@ export default {
},
data () {
return {
value: '',
timer: null
}
},
@ -63,6 +65,7 @@ export default {
},
mounted () {
this.chartInit()
this.changeStyle(this.config)
},
beforeDestroy () {
//
@ -97,9 +100,13 @@ export default {
handleInput (val) {
//
this.debounce(() => {
console.log('val', val)
this.linkage({ [this.config.code]: val })
})
},
keyupEnter () {
this.linkage({ [this.config.code]: this.value })
},
debounce (fn, delay = 500) {
clearTimeout(this.timer)
this.timer = setTimeout(() => {

Loading…
Cancel
Save