Browse Source

perf: complex table (#2732)

Move ont format `{row}`
pull/2739/head
Phạm Ngọc Hòa 5 years ago committed by 花裤衩
parent
commit
b11acb2171
  1. 20
      src/views/table/complex-table.vue

20
src/views/table/complex-table.vue

@ -36,13 +36,13 @@
@sort-change="sortChange" @sort-change="sortChange"
> >
<el-table-column label="ID" prop="id" sortable="custom" align="center" width="80" :class-name="getSortClass('id')"> <el-table-column label="ID" prop="id" sortable="custom" align="center" width="80" :class-name="getSortClass('id')">
<template slot-scope="scope"> <template slot-scope="{row}">
<span>{{ scope.row.id }}</span> <span>{{ row.id }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="Date" width="150px" align="center"> <el-table-column label="Date" width="150px" align="center">
<template slot-scope="scope"> <template slot-scope="{row}">
<span>{{ scope.row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span> <span>{{ row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="Title" min-width="150px"> <el-table-column label="Title" min-width="150px">
@ -52,18 +52,18 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="Author" width="110px" align="center"> <el-table-column label="Author" width="110px" align="center">
<template slot-scope="scope"> <template slot-scope="{row}">
<span>{{ scope.row.author }}</span> <span>{{ row.author }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="showReviewer" label="Reviewer" width="110px" align="center"> <el-table-column v-if="showReviewer" label="Reviewer" width="110px" align="center">
<template slot-scope="scope"> <template slot-scope="{row}">
<span style="color:red;">{{ scope.row.reviewer }}</span> <span style="color:red;">{{ row.reviewer }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="Imp" width="80px"> <el-table-column label="Imp" width="80px">
<template slot-scope="scope"> <template slot-scope="{row}">
<svg-icon v-for="n in +scope.row.importance" :key="n" icon-class="star" class="meta-item__icon" /> <svg-icon v-for="n in + row.importance" :key="n" icon-class="star" class="meta-item__icon" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="Readings" align="center" width="95"> <el-table-column label="Readings" align="center" width="95">

Loading…
Cancel
Save