数据格式
tableData: [
{
elcInfo: [{
tableData:[
1,
293021.1,
293021.1,
293021.1,
293021.1,
]
}]
},
{
elcInfo: [{
tableData:[
1,
293021.1,
293021.1,
293021.1,
293021.1,
]
}]
},
{
elcInfo: [{
tableData:[
1,
293021.1,
293021.1,
293021.1,
293021.1,
]
}]
},
/* {
title: "2",
elcInfo: [{
tableData:[
293021.1,
293021.1,
293021.1,
293021.1,
]
}]
},
{
title: "3",
elcInfo: [{
tableData:[
293021.1,
293021.1,
293021.1,
293021.1,
]
}]
},*/
],
tableHeader: {
dateData: [
'序号', "结算类型","电量","电价","电费"
]
},
?子组件:
<template>
<u-table>
<u-tr>
<u-th v-for="item in header">{{item}}</u-th>
</u-tr>
<u-tr v-for="item in data">
<u-td v-for="i in item">{{ i }}</u-td>
</u-tr>
</u-table>
</template>
<script>
export default {
name: "XTable",
props: {
header: {
type: Object,
default: {},
},
data: [],
},
}
</script>