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 將子組件的值渲染傳遞給父組件

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM