猿问

VUE element el-table 怎么按后台数据排列列的顺序

1.表格列要求可以根据从后台请求到的数据指定显示的列、列宽、顺序

2.<div class="table-div-warp">


  <el-table ref="multipleTable" :data="tableData" stripe size="mini" resizable border

            style="width: 100%" :height="tableHeight">

    <el-table-column :label="'Quote_001' | localesFilter " prop="partnerCompanyName"

                     show-overflow-tooltip></el-table-column>

    <el-table-column :label="'Quote_002' | localesFilter " prop="transType" show-overflow-tooltip></el-table-column>

    <el-table-column :label="'Quote_003' | localesFilter " prop="destName" show-overflow-tooltip></el-table-column>

    <el-table-column :label="'Quote_004' | localesFilter " prop="goodsTypeName" show-overflow-tooltip></el-table-column>

    <el-table-column :label="'Quote_005' | localesFilter " prop="packingType"

                     show-overflow-tooltip></el-table-column>

    <el-table-column :label="'Quote_006' | localesFilter " prop="weight" show-overflow-tooltip></el-table-column>

    <el-table-column :label="'Quote_007' | localesFilter " prop="vol" show-overflow-tooltip></el-table-column>

    <el-table-column :label="'Quote_008' | localesFilter " prop="unitPrice" show-overflow-tooltip></el-table-column>

    <el-table-column :label="'Quote_009' | localesFilter " prop="carriage" show-overflow-tooltip></el-table-column>

    <el-table-column :label="'Quote_010' | localesFilter " prop="totalPrice"

                     show-overflow-tooltip></el-table-column>

    <el-table-column :label="'Quote_011' | localesFilter " prop="designFormulas"

                     show-overflow-tooltip></el-table-column>

    <el-table-column :label="'Quote_012' | localesFilter " prop="timeLimit" show-overflow-tooltip></el-table-column>

    <el-table-column :label="'ORDERS_46' | localesFilter " prop="designFormulas" align="center">

      <template slot-scope="scope">


3.这些表头都是先定义好,可以通过判断来是否显示,但是做不到动态显示指定列啊

4.

一只名叫tom的猫
浏览 7147回答 2
2回答

幕布斯7119047

<el-table-column v-for="item in data" :width='item.width' ></el-table-column>你可以通过data控制列、列宽、顺序

至尊宝的传说

我先试试。大佬
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答