// Input 输入框
// 通过鼠标或键盘输入字符
// Input 为受控组件,它总会显示 Vue 绑定值。
// 通常情况下,应当处理 input 事件,并更新组件的绑定值(或使用v-model)。否则,输入框内显示的值将不会改变。
// 不支持 v-model 修饰符。
<template>
<div>
<el-input v-model="params.testObj" @input="change"></el-input>
</div>
</template>
<script>
export default {
name: 'Test',
data() {
return {
params: {
testObj: ''
}
}
},
created() {
this.getData()
},
methods: {
getData() {
const res = {
aaa: 'aaa',
bbb: 'bbb',
ccc: 'ccc'
}
this.params = res
this.params.testObj = res.testObj
},
change(){
this.$forceUpdate()
},
}
}
</script>
<style scoped>
</style>