vue + element-ui实现表格嵌套

效果
在这里插入图片描述
数据结构:
在这里插入图片描述
html:

<el-table
              :data="tableData"
              :header-cell-style="{textAlign:'center'}"
              :cell-style="{textAlign:'center'}"
              style="width: 100%">
                <el-table-column
                  fixed="left"
                  prop="hall.hall_name"
                  label="场地"
                  width="120">
                </el-table-column>
                <el-table-column  v-for="(item,index) in columnFirstOptions" :key="index" :label="item.date" >
                   <el-table-column
                     width="120"
                     label="上午">
                     <template slot-scope="scope"  >
                       <span
                         class="order"
                         v-if="scope.row.list[index].occupier[0].id"
                         @click="getDetails(scope.row.list[index].occupier[0].id)">{{scope.row.list[index].occupier[0].name}}                  	
                         </span>
                     </template>
                   </el-table-column>
                  <el-table-column
                    width="120"
                    label="下午">
                    <template slot-scope="scope"  >
                      <span
                        v-if="scope.row.list[index].occupier[1].id"
                        class="order"
                        @click="getDetails(scope.row.list[index].occupier[1].id)">{{scope.row.list[index].occupier[1].name}}</span>
                    </template>
                  </el-table-column>
                  <el-table-column
                    width="120"
                    label="晚上">
                    <template slot-scope="scope"  >
                      <span
                        v-if="scope.row.list[index].occupier[2].id"
                        class="order"
                        @click="getDetails(scope.row.list[index].occupier[2].id)">{{scope.row.list[index].occupier[2].name}}</span>
                    </template>
                  </el-table-column>
                </el-table-column>
            </el-table>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值