el-table-column
时间: 2023-10-27 15:46:29 浏览: 146
ec属性 ec:table ec:column
5星 · 资源好评率100%
el-table-column is a component in the Element UI library that is used to define the columns of a table. It is used in conjunction with the el-table component to create a table that displays data in a tabular format.
The el-table-column component has several attributes that can be used to define the properties of each column, such as the column title, width, alignment, and data format. It also allows for customization of the column header and cell content through the use of scoped slots.
Some of the commonly used attributes of el-table-column include:
- prop: the field name of the data object that the column displays
- label: the title of the column
- width: the width of the column
- align: the alignment of the column content (left, center, right)
- formatter: a function that formats the data displayed in the column
Example usage:
<template>
<el-table :data="tableData">
<el-table-column prop="name" label="Name" width="180"></el-table-column>
<el-table-column prop="age" label="Age" width="100"></el-table-column>
<el-table-column prop="address" label="Address"></el-table-column>
</el-table>
</template>
In this example, the el-table-column components define three columns in a table that displays data from the tableData array. The "name" column has a width of 180 pixels, while the "age" column has a width of 100 pixels. The "address" column does not have a set width and will expand to fill the remaining space in the table.
阅读全文