[Solve the problem that the el-input input box in Vue cannot be edited]

1. Problem description

  In a development project using the Vue framework, when the tag is echoed to the input tag based on the value returned by the backend, it is found that it can be echoed normally, but cannot be edited.

Before repair:

  No matter what content is entered, the text box cannot be filled.
Insert image description here

After repair:

Insert image description here

2. Problem solving

  You can use forceUpdate to force rendering. Add a method to the input box, and the method is forceUpdate.
Insert image description here
Insert image description here

<el-form-item label="业绩归属">
   <el-input v-model="inputNode.business_org_code" @input="onInput()"></el-input>
 </el-form-item>
<el-form-item label="管理架构">
   <el-input v-model="inputNode.manager_org_code" @input="onInput()"></el-input>
 </el-form-item>
	onInput() {
    
    
      //input输入框无法编辑
      this.$forceUpdate();
    }

Guess you like

Origin blog.csdn.net/qq_45278500/article/details/128217505