[Vue warn]: Error in beforeDestroy hook: "Error: [ElementForm]unpected width

created at 08-23-2021 views: 30

description

Vue project, Element framework, running error:

[Vue warn]: Error in beforeDestroy hook: "Error: [ElementForm]unpected width
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
      <el-form-item label="form name" label-width="auto"  prop="tableName"

Official:
el-form:
| label-width | The width of the form field label, such as '50px'. The form-item that is a direct child element of Form will inherit this value. Support auto.

Conflict, el-form-item inherits the specific size of 120px after setting label-width="120px" in el-form, it is not auto, so an error is reported
Just set the label-width in el-form-item to a specific size

<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
      <el-form-item label="form name" label-width="50px"  prop="tableName"
created at:08-23-2021
edited at: 08-23-2021: