Record a problem. When using element-table, only one input box is displayed when rendering multiple pieces of data, and other data is rendered based on the input value of the input box.

        Record a problem and encounter a requirement. When using element-table, only one input box will be displayed when rendering multiple pieces of data, and other data will be rendered based on the input value of the input box.

        Style to implement:

        This problem can be solved using element-table index. Here we just add the disabling of the input box. If you need other styles, you can add v-if to render other DOM.

<el-table-column 
  width="160" 
  align="center" 
  label="其他" 
  type="index" // 设置 type = index 属性,设置后默认宽度为50,需要自己加宽度
>    <template slot-scope="scope">
        <el-input type="text"
        v-model="agentCapitalPriceRequestVO.agentPrice"
        :disabled="!(scope.$index == 0)" // 禁用方式,借用 index 来禁用想要金庸的条件,但是需要加 $ 符号,如果想要禁用多个,可以自己设置禁用条件,这里只设置一个
        />
    </template>
</el-table-column>

Guess you like

Origin blog.csdn.net/z_langjitianya/article/details/131223335