试一下下面这段代码,可以看到,scope.row 包含了当前行的所有字段,此时,你可以直接使用 scope.row.fieldName 来显示任意字段,以及使用模板构造任意字段的组合。
```
#### scope.$index 获取当前行下标
```
```
通过`scope.row.属性名`可以获取当前行对应的属性值
```
```
<el-table-column label="列标题">
<template slot-scope="scope">
{{scope.row}}
</template>
</el-table-column>
```
```
<el-table-column align="center"
label="首重(首件)价格"
>
<template slot-scope="scope">
<span v-for="(item,index) in scope.row.transfees" v-if="index == 0">{{item.exp_info_firstprice}}</span>
</template>
</el-table-column>
```
```
<template slot-scope="scope">
<span v-for="(item,index) in scope.row.transfees" v-if="index == 0">{{item.exp_info_firstprice}}</span>
</template>
```
```
(item,index) in scope.row.transfees
```
```
"data": [
{
"exp_id": 6,
"exp_title": "标题BBD",
"exp_mid": 0,
"exp_type": 2,
"exp_preset": 1,
"exp_update_time": 1628645708,
"exp_status": 1,
"transfees": [
{
"exp_info_id": 8,
"exp_info_expid": 6,
"exp_info_exptitle": "标题BBD",
"exp_info_provincesid": "",
"exp_info_cityid": "",
"exp_info_countytitle": "",
"exp_info_type": 1,
"exp_info_firstnum": 1,
"exp_info_firstprice": "5.00",
"exp_info_renum": 7,
"exp_info_reprice": "2.00",
"exp_info_status": "1"
},
{
"exp_info_id": 9,
"exp_info_expid": 6,
"exp_info_exptitle": "标题BBD",
"exp_info_provincesid": "",
"exp_info_cityid": "",
"exp_info_countytitle": "",
"exp_info_type": 1,
"exp_info_firstnum": 2,
"exp_info_firstprice": "3.00",
"exp_info_renum": 4,
"exp_info_reprice": "5.00",
"exp_info_status": "1"
}
]
},
]
```
- webpack-dev-server不是内部或外部命令
- vue+ele添加笑脸表情
- from UglifyJs Unexpected token: punc (()
- vmodel-ref
- jscopy
- watch_or_computed
- checkbox-group
- array_filter
- array many filter
- js array unshift
- vue watch one
- sku
- edit-button
- el-select clearable placeholder
- 必填
- 如何设置一个索引从1开始
- Injection "elForm" not found
- $refs
- resetFields
- table 二级数据
- Table 合并
- switch 开关
- radio group 单选
- 二级菜单
- 访问页面出错后退到上一页
- 编辑器tinymce
- v-for从1开始索引
- 图片绑定路径
- 分栏间隔
- class绑定card底色
- 动态增减表单项
- watch deep
- form 获取值
- table索引方法
- table两个改一个另一个也跟着变解决方法
- table标题改整列
- vue echarts