element-ui 中的 slot-scope="scope
实例运用到的组件:
这里的实例 运用 element 的
- 表格组件:el-table
- 下拉菜单:el-dropdown
用法
< template slot-scope="scope" >{
{
scope.$index }} {
{
scope.row }}</template>
实例代码,详细解释在注释中:
<el-table :data="tableData" style="width: 100%"> <!-- :data="用于存放请求数据回来的数组" -->
<el-table-column label="索引值" width="400">
<template slot-scope="scope"> <!-- slot-scope="scope" 这里取到当前单元格 --> <span>{
{
scope.$index }}</span>