组件路径
src\components\Common\table.vue
效果

使用方法
<template>
<search-table :tableDates="tableDates" :tableColumn="tableColumn"></search-table>
</template>
import searchTable from '../Common/table.vue'
export default {
data() {
return {
tableDates: [
{
time: '2017/4/27 11:33:11',
agent: '马翠霞(000081)13793636533',
password: '123456',
create: '孙晓丽(000080)17667191313',
leader: '孙晓丽(000080)17667191313',
level: '经理',
type: '新发展',
number: '000081',
status: '待审核'
}
],
tableColumn: [
{ label: '发展时间', prop: 'time', width: '190' },
{ label: '代理商', prop: 'agent', width: '150' },
{ label: '初始密码', prop: 'password', width: '190' },
{ label: '推荐人', prop: 'create', width: '190' },
{ label: '上级', prop: 'leader', width: '190' },
{ label: '级别', prop: 'level', width: '130' },
{ label: '类别', prop: 'type', width: '190' },
{ label: '授权号', prop: 'number', width: '190' },
{ label: '审核状态', prop: 'status', width: '130' },
{ label: '操作',
prop: 'create',
width: '250',
operations: [
{ label: '修改', func: this.disableTag },
{ label: '详情', func: this.disableTag },
{ label: '审核通过', func: this.disableTag },
{ label: '审核不通过', func: this.disableTag }
]
}
]
}
}
}
data
tableColumn
| 参数 | 类型 | 说明 |
|---|---|---|
| label | String | 表格标题 |
| prop | String | 表格数据,指向tableData的同名属性值 |
| width | String | 表格宽度 |
| operations | Array | 用于配置表格按钮,label(按钮名称),func(按钮方法) |