🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
试一下下面这段代码,可以看到,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" } ] }, ] ```