試一下下面這段代碼,可以看到,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