最近要做一个表格,但是为了方便维护,我们需要把表格数据循环出来,方便加减节点:
<template>
<el-table :data="tableData" style="width: 100%">
<el-table-column
:prop="item.porp"
:label="item.label"
width="180"
v-for="item in data"
:key="item.key"
></el-table-column>
</el-table>
</template>

<script>
export default {
data() {
return {
data: [
{ label: "编码1日期", porp: "date"},
{ label: "编码2名字", porp: "name"},
{ label: "编码3住址", porp: "address"},
],
tableData: [{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄'
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
}, {
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄'
}]
};
}
};
</script>

<style lang="scss" scoped>
</style>

相关文章:

  • 2021-06-22
  • 2022-01-01
  • 2022-12-23
  • 2021-11-16
  • 2021-11-12
  • 2022-12-23
  • 2021-07-12
  • 2021-11-21
猜你喜欢
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
相关资源
相似解决方案