el-table实现纵向表格

334 阅读1分钟

el-table实现纵向表格

<div v-for="(val, dard) in titlelistName" :key="dard">
                      <div class="tabletitlebox content_list" :style="{ width: scrollerWidth }">{{ val.title }}</div>
                      <el-table
                        :id="val.title"
                        :row-class-name="tableRowClassName"
                        :show-header="false"
                        :data="val.colmuntitle"
                        ref="table"
                        :key="itemKey"
                      >
                        <el-table-column prop="title" label="" width="209" fixed>
                          <template slot-scope="scope">
                            <span>{{ val.colmuntitle[scope.$index].title }}</span>
                          </template>
                        </el-table-column>
                        <el-table-column v-for="(data, index) in val.tableconten" :key="index" width="320">
                          <template slot-scope="scope">
                            <div v-if="['e75d7bab-a6aa-40f7-b97a-3f5faa6ff397'].includes(scope.row.key)">
                              <el-rate
                                disabled-void-color="#BBBDC7"
                                v-model="data[scope.row.key]"
                                disabled
                                :colors="['#01A0AC', '#01A0AC', '#01A0AC']"
                              ></el-rate>
                            </div>
                            <div v-else-if="['url', 'file'].includes(scope.row.type) && data[scope.row.key] !== '--'">
                              <a :href="data[scope.row.key]">{{ data[scope.row.key] }}</a>
                            </div>
                            <span v-else>{{ data[scope.row.key] }}</span>
                          </template>
                        </el-table-column>
                      </el-table>
                    </div>

image.png image.png

image.png

image.png