search

Home  >  Q&A  >  body text

javascript - Can the value of fixed header height of element ui table be a variable?

Use element ui's table table to set the height attribute of the table content. Can you set the variable without hard-coding? The height of different screens is different. For example, in the following code, height="250", how can the attribute value be implemented using a variable?

<el-table

:data="tableData3"
height="250"
border
style="width: 100%">
<el-table-column
  prop="date"
  label="日期"
  width="180">
</el-table-column>
<el-table-column
  prop="name"
  label="姓名"
  width="180">
</el-table-column>
<el-table-column
  prop="address"
  label="地址">
</el-table-column>

</el-table>

为情所困为情所困2786 days ago1669

reply all(1)I'll reply

  • 習慣沉默

    習慣沉默2017-07-05 10:37:46

    //定义变量
    const a = 200;
    //使用变量,注意冒号
    :height="a"

    reply
    0
  • Cancelreply