Vue + Element 表格循环渲染

 

 

 

 <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 将子组件的值渲染传递给父组件

 

相关文章:

  • 2022-12-23
  • 2021-11-16
  • 2021-12-07
  • 2021-10-28
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
猜你喜欢
  • 2022-12-23
  • 2019-10-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案