|
| 1 | +<template> |
| 2 | + <t-layout-page> |
| 3 | + <t-layout-page-item> |
| 4 | + <t-table :table="table" :isShowPagination="false" :columns="table.columns"> |
| 5 | + <template #slotNameHeader="{param}">{{param.row.date1}}</template> |
| 6 | + <template #slotNameHeader1="{param}">{{param.row.name}}</template> |
| 7 | + <template #slotNameHeader12="{param}">{{param.row.date1}}</template> |
| 8 | + </t-table> |
| 9 | + </t-layout-page-item> |
| 10 | + </t-layout-page> |
| 11 | +</template> |
| 12 | + |
| 13 | +<script> |
| 14 | +export default { |
| 15 | + data() { |
| 16 | + return { |
| 17 | + table: { |
| 18 | + columns: [ |
| 19 | + { |
| 20 | + prop: 'name', label: '姓名', minWidth: '100', |
| 21 | + children: [ |
| 22 | + { |
| 23 | + prop: 'name', label: '姓名', minWidth: '100', |
| 24 | + children: [ |
| 25 | + { |
| 26 | + prop: 'type', label: '类型', minWidth: '100', |
| 27 | + children: [ |
| 28 | + { prop: 'date1', label: '日期2552', minWidth: '180', }, |
| 29 | + ] |
| 30 | + }, |
| 31 | + ] |
| 32 | + }, |
| 33 | + { |
| 34 | + prop: 'type', label: '表头合并1', minWidth: '100', |
| 35 | + children: [ |
| 36 | + { |
| 37 | + prop: 'type', label: '类型', minWidth: '100', |
| 38 | + children: [ |
| 39 | + { prop: 'date1', label: '日期2552', minWidth: '180' }, |
| 40 | + ] |
| 41 | + }, |
| 42 | + ] |
| 43 | + }, |
| 44 | + { prop: '', label: '姓名插槽显示', minWidth: '100', slotNameMerge: 'slotNameHeader1', }, |
| 45 | + { |
| 46 | + prop: 'date', label: '表头合并2', minWidth: '180', |
| 47 | + children: [ |
| 48 | + { prop: 'type', label: '类型', minWidth: '100', }, |
| 49 | + { |
| 50 | + prop: 'date', label: '日期', minWidth: '180', |
| 51 | + children: [ |
| 52 | + { prop: 'date1', label: '日期22', minWidth: '180', }, |
| 53 | + ] |
| 54 | + } |
| 55 | + ] |
| 56 | + }, |
| 57 | + ] |
| 58 | + }, |
| 59 | + { |
| 60 | + prop: 'name', label: '姓名', minWidth: '100', |
| 61 | + children: [ |
| 62 | + { |
| 63 | + prop: 'type', label: '类型', minWidth: '100', children: [ |
| 64 | + { prop: 'date1', label: '日期插槽显示', minWidth: '180', slotNameMerge: 'slotNameHeader12', }, |
| 65 | + ] |
| 66 | + }, |
| 67 | + ] |
| 68 | + }, |
| 69 | + { |
| 70 | + prop: 'type', label: '表头合并1', minWidth: '100', |
| 71 | + children: [ |
| 72 | + { |
| 73 | + prop: 'type', label: '类型', minWidth: '100', children: [ |
| 74 | + { prop: 'date1', label: '日期2552', minWidth: '180', }, |
| 75 | + ] |
| 76 | + }, |
| 77 | + ] |
| 78 | + }, |
| 79 | + { prop: 'name', label: '姓名', minWidth: '100', }, |
| 80 | + { |
| 81 | + prop: 'date', label: '表头合并2', minWidth: '180', |
| 82 | + children: [ |
| 83 | + { prop: 'type', label: '类型', minWidth: '100', }, |
| 84 | + { |
| 85 | + prop: 'date', label: '日期', minWidth: '180', |
| 86 | + children: [ |
| 87 | + { prop: 'date1', label: '日期22', minWidth: '180', }, |
| 88 | + ] |
| 89 | + } |
| 90 | + ] |
| 91 | + }, |
| 92 | + { prop: 'address', label: '地址', minWidth: '220', }, |
| 93 | + { prop: 'date1', label: '不合并显示插槽', minWidth: '180', slotName: 'slotNameHeader', }, |
| 94 | + { prop: 'address1', label: '地址', minWidth: '220', } |
| 95 | + ], |
| 96 | + data: [ |
| 97 | + { |
| 98 | + id: '1', |
| 99 | + type: '入库', |
| 100 | + date: '2019-09-25', |
| 101 | + date1: '2019-09-25', |
| 102 | + name: '张三', |
| 103 | + status: '2', |
| 104 | + address: '广东省广州市天河区', |
| 105 | + address1: '广东省广州市天河区', |
| 106 | + }, |
| 107 | + { |
| 108 | + id: '2', |
| 109 | + type: '入库', |
| 110 | + date: '2019-09-26', |
| 111 | + date1: '2019-09-26', |
| 112 | + name: '张三1', |
| 113 | + status: '1', |
| 114 | + address: '广东省广州市天广东省广州市天河区2广东省广州市天河区2河区2', |
| 115 | + address1: '广东省广州市天广东省广州市天河区2广东省广州市天河区2河区2' |
| 116 | + }, |
| 117 | + { |
| 118 | + id: '3', |
| 119 | + type: '入库', |
| 120 | + date: '2019-09-27', |
| 121 | + date1: '2019-09-27', |
| 122 | + name: '张三2', |
| 123 | + status: '3', |
| 124 | + address: '广东省广州市天河区3', |
| 125 | + address1: '广东省广州市天河区3', |
| 126 | + }, |
| 127 | + { |
| 128 | + id: '4', |
| 129 | + type: '出库', |
| 130 | + date: '2019-09-27', |
| 131 | + date1: '2019-09-27', |
| 132 | + name: '张三3', |
| 133 | + status: '3', |
| 134 | + address: '广东省广州市天河区3', |
| 135 | + address1: '广东省广州市天河区3', |
| 136 | + }, |
| 137 | + { |
| 138 | + id: '5', |
| 139 | + type: '出库', |
| 140 | + date: '2019-09-27', |
| 141 | + date1: '2019-09-27', |
| 142 | + name: '张三4', |
| 143 | + status: '3', |
| 144 | + address: '广东省广州市天河区3', |
| 145 | + address1: '广东省广州市天河区3' |
| 146 | + } |
| 147 | + ], |
| 148 | + }, |
| 149 | + } |
| 150 | + } |
| 151 | +} |
| 152 | +</script> |
0 commit comments