HTML
使用的是展开行type="expand",并在样式里隐藏展开符,默认展开 :default-expand-all="true"
<template>
<div class="ca-app-container">
<!-- 顶部 -->
<div class="cover">
<veryTop></veryTop>
</div>
<!-- tabs -->
<div class="tabs" v-show="diaogShow&&diaogShowSea">
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="普通" name="first"></el-tab-pane>
<el-tab-pane label="海外购" name="second"></el-tab-pane>
<!-- <el-tab-pane label="订购" name="third"></el-tab-pane> -->
</el-tabs>
</div>
<div class="noList" v-if="paramsList.length===0">
<img src="../../assets/noList.png">
购物车空空的哦~,去看看心仪的商品吧~
</div>
<div class="c-content" v-show="diaogShow&&diaogShowSea" v-else>
<!-- 表头 -->
<!-- <div class="cart-table-th">
<span class="th th-item">商品信息</span>
<span class="th th-info"> </span>
<span class="th th-type">规格</span>
<span class="th th-price">单价</span>
<span class="th th-amount">数量</span>
<span class="th th-sum">金额</span>
<span class="th th-op">操作</span>
</div> -->
<div class="J_OrderList">
<!-- 表格 @select="handleSelectionChange" -->
<el-table :data="paramsList" ref="tableF" @selection-change="testhandChange" :row-key="getRowKey"
:default-expand-all="true" @select="Selection">
<el-table-column type="expand">
<el-table-column :reserve-selection="true" width="55" type="selection"
:selectable='handleCheckbox1'>
</el-table-column>
<el-table-column :reserve-selection="true" width="255">
<template slot-scope="scope">
<span class="titleNameOne"> 店铺:{
{scope.row.name}}</span>
</template>
</el-table-column>
<el-table-column type="expand">
<template slot-scope="scope">
<div class="titleName">
<!-- 第二层表格 :ref="'tableChildSon' + scope.$index" ref="multipleTable" @select="handleSelectionChange3"-->
<el-table :ref="'tableChildSon' + scope.row.id" :data="scope.row.goodsList"
:default-expand-all="true" @select="itemHandleSelection"
@selection-change="testhandChange3" :row-key="getRowKeyTwo">
<el-table-column type="selection" :reserve-selection="true"
:selectable='handleCheckbox3' width="45" align="center" size="45">
</el-table-column>
<el-table-column>
<template slot-scope="scopeSon">
<div class="o-main">
<div class="main-left">
<!-- 第3层表格 -->
<el-table :data="scopeSon.row.spuList" :show-header="false"
:default-expand-all="true" :row-key="getRowKeyThree">
<el-table-column width="180" align="center">
<template slot-scope="scopeSons">
<div class="main-left-img"
@click="toGood(scopeSon.row)"
v-if="scopeSons.row.image===''">
<img :src="scopeSon.row.exhibition" />
</div>
<div class="main-left-img" v-else
@click="toGood(scopeSon.row)">
<img :src="scopeSons.row.image" />
</div>
</template>
</el-table-column>
<!-- :show-overflow-tooltip="true" -->
<el-table-column align="center" prop="name" label="商品信息"
width="230">
<div class="goodName">
{
{scopeSon.row.name}}
</div>
</el-table-column>
<el-table-column align="center" width="330" label="规格"
prop="skuNames">
<template slot-scope="scopeSons">
<div class="main-right-F">
<div class="main-header">
{
{scopeSons.row.skuNames}}
</div>
</div>
</template>
</el-table-column>
<el-table-column width="100" label="单价" prop="price">
<template slot-scope="scopeSons">
¥{
{scopeSons.row.price}}
</template>
</el-table-column>
<el-table-column width="210" label="数量" prop="num">
<template slot-scope="scopeSons">
<!-- ¥{
{scopeSons.row.num}} -->
<el-input-number v-model="scopeSons.row.num"
size="mini"
@change="handleChange(scopeSons.row)" :min="1"
label="描述文字"
:disabled="scopeSons.row.isStock==0?true:false">
</el-input-number>
</template>
</el-table-column>
<el-table-column width="120" label="金额" prop="totalPrice">
<template slot-scope="scopeSons">
<div class="totalPrice">
¥{
{scopeSons.row.totalPrice}}
</div>
</template>
</el-table-column>
<el-table-column label='操作' width="160">
<template slot-scope="scope">
<div class="curporF">
<!--v-if="item.isStock==0"> -->
<div class="curpor handle-txt"
style="background-color: #5799de;color: #fff;"
v-if="scope.row.isStock==0">
已售罄
</div>
<!-- <div class="curpor handle-txt" @click="deleteShops(item)"> -->
<div class="curpor handle-txt"
@click="deleteShops(scope.row)">
删除
</div>
<!-- <div class="curpor handle-txt" @click="addCollection(item)"> -->
<div class="curpor handle-txt"
@click="addCollection(scope.row)">
移入收藏夹
</div>
</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
</el-table-column>
</el-table><!-- 2 -->
</div>
</template>
</el-table-column>
</el-table-column>
<el-table-column type="" label="商品信息" align="center" width="100" class="tile"></el-table-column>
<el-table-column label="规格" width="380" align="center"></el-table-column>
<el-table-column label="单价" width="80" align="center"></el-table-column>
<el-table-column label="数量" align="center" width="180"></el-table-column>
<el-table-column label="金额" align="center" width="180"></el-table-column>
<el-table-column label="操作" align="center" width="155"></el-table-column>
<!-- <el-table-column label="操作" align="center" width="415" style="margin-left: -100rem;"></el-table-column> -->
</el-table>
</div>
<!-- </div> -->
<div class="float-bar-wrapper">
<div class="select-all" v-if="this.natureIndex==0">
<el-checkbox-group v-model="allType" @change="handleCheckAllChange">
<el-checkbox label="全选" name="type" :checked="allType" style=""></el-checkbox>
</el-checkbox-group>
</div>
<div class="operations">
<span class="operations-item" @click="batchDelete()">全部删除 </span>
<!-- <span class="operations-item" @click="batchColle()">移入收藏夹</span> -->
</div>
<div class="float-bar-right">
<div class="amount-sum">
<span>已选商品</span>
<span>{
{this.shoped}}</span>
<span>件</span>
</div>
<div class="price-sum">
<span>合计:{
{this.priceed.toFixed(2)}}</span>
</div>
<div class="btn-area">
<el-button class="btn-area-elbtn" type="info" round @click="buy" :plain="true">结算</el-button>
</div>
</div>
</div>
</div>
<el-dialog :visible.sync="dialogVisibleAllDel" width="30%">
<div class="cart-el-dialog-content">
<span>确定全部删除吗?</span>
</div>
<span class="dialog-footer">
<el-button @click="dialogVisibleAllDel = false">取 消</el-button>
<el-button type="primary" @click="sure">确 定</el-button>
</span>
</el-dialog>
<!-- 结算组件 -->
<div class="">
<confirm v-show="!diaogShow" :infoShow.sync="diaogShow" ref="mychild"
:dialogFormVisible.sync="dialogFormVisible" :user="user" />
<overseasConfirm v-show="!diaogShowSea" :infoShowSea.sync="diaogShowSea" ref="mychildSea"
:dialogFormVisibleSea.sync="dialogFormVisibleSea" :userSea="userSea" />
</div>
<div class="footer">
<!-- <Footer></Footer> -->
</div>
<!-- 返回顶部 -->
<div class="backtop">
<el-backtop :bottom="100" :visibility-height="100"></el-backtop>
</div>
</div>
</template>
css
//表头
.el-table__header-wrapper{
// margin-left: -50% !important;
color: #000000;
font-family: '宋体';
font-weight: bold;
background-color: #f5f7fa !important;
}
.el-table thead tr th{
border: 0px solid #ddd!important;
// border-top-left-radius: 10px;
// border-top-right-radius: 10px;
}
//多选框
.el-table__header-wrapper{
.el-checkbox__inner{
display: none;