When solving the element-ui form disabled state, the components or other elements contained in its form are not disabled

When solving the element-ui form disabled state, the components or other elements contained in its form are not disabled

(1) example
<el-form
  ref="Form"
  v-loading="form_loading"
  :model="model"
  label-position="right"
  label-width="110px"
  size="small"
  :disabled="form_disabled"
  :rules="rules"
>
    <el-form-item prop="name" label="名字">
        <el-input v-model="model.name" disabled clearable />
    </el-form-item>
    <el-form-item>
        <zujian /> <!-- 自定义组件 -->
    </el-form-item>
</el-form>
(2) zujian.vue (to make the custom component affect its outer form. It can be solved by adding a new el-form inside the component)
<el-form :disabled="false">
    <!-- 自定义组件的代码 -->
</el-form>

Guess you like

Origin blog.csdn.net/qq_45616003/article/details/126832877