<template>
<el-table :data="tableData" style="width: 100%">
//---:data="用于存放请求数据回来的数组"
<el-table-column label="索引值" width="400">
<template slot-scope="scope">
//--- 这里取到当前单元格
<span>{
{ scope.$index }}</span>//--- scope.$index就是索引
</template>
</el-table-column>
<el-table-column label="标题" width="350">
<template slot-scope="scope">
//--- 这里取到当前单元格
<span>{
{ scope.row.title }}</span>
//--- scope.row 直接取到该单元格对象,就是数组里的元素对象,即是tableData[scope.$index]
//---.title 是对象里面的title属性的值
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
//--- 这里取到当前单元格
<
slot-scoped 自我笔记
最新推荐文章于 2024-06-05 23:04:32 发布