解决el-form中的输入框,或者下拉框无法修改赋值

使用this.$forceUpdate()进行强制渲染

el-input添加@input事件,el-select添加@change事件,方法为:

<el-input
            @input="defaultValueChange"
              v-model="queryParams.irNumber"
              :placeholder="$t('IRRequest.pleaseEnterIrNumber')"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"/>
            </el-form-item>
<el-form-item :label="$t('IRRequest.Line')">
              <el-select v-model="queryParams.line" :placeholder="$t('IRRequest.Line')" clearable size="small" @change="defaultValueChange2">
                <el-option
                  v-for="dict in dict.type.sys_Line"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
      methods: {
        
          defaultValueChange(){
              this.$forceUpdate();
          },
          defaultValueChange1(){
              this.$forceUpdate();
          },
}

上一篇:Cmake Learn


下一篇:Linux进程