Skip to content

表格

html
<div class="demo-line">
    <feng-table :header-data="tableHeaders" :data="tableData" :height="250" :min-width="500" row-key="id"></feng-table>
</div>
javascript
const tableHeaders = [
    {
        text: '姓名',
        prop: 'name'
    },
    {
        text: '年龄',
        prop: 'age'
    },
    {
        text: '性别',
        prop: 'sex'
    }
]

const tableData = ref([
    {
        id: 1,
        name: '张三',
        age: 18,
        sex: '男'
    },
    {
        id: 2,
        name: '李四',
        age: 19,
        sex: '女'
    },
    {
        id: 3,
        name: '王五',
        age: 20,
        sex: '男'
    },
    {
        id: 4,
        name: '赵六',
        age: 21,
        sex: '女'
    }
])

属性

属性名说明默认值
header-data表头数据[]
header-data.text表头文本''
header-data.prop表头属性名''
data数据[]
height高度0
min-width最小宽度0
row-key行数据的key''