<el-table-column label="查看职位" width="250"> <slot slot-scope="scope"> <el-link style="padding:0 5px" v-for="(v,index) in scope.row.job_ids" v-if='scope.row.job_ids !=""' type="primary" >职位{{index}}</el-link> </slot> </el-table-column> <el-table-column prop="route_path" label="查看门店" width="250"> <slot slot-scope="scope"> <el-link style="padding:0 5px" v-for="(v,index) in scope.row.job_ids" v-if='scope.row.job_ids !=""' type="primary" >职位{{index}}</el-link> </slot> </el-table-column>
主要是 运用 slot标签 + 作用域插槽 slot-scope + v-for 将子组件的值渲染传递给父组件