Vue.element表单排序没效果
发布于 3 年前 作者 huaer 1305 次浏览 来自 问答
粉丝福利 : 关注VUE中文社区公众号,回复视频领取粉丝福利

<mu-data-table selectable select-all :selects.sync=“selects” :loading=“tableLoading”

:columns=“columns” :sort.sync=“sort” [@sort-change](/user/sort-change)=“handleSortChange” :data=“list” >

{{scope.row.title}}
{{scope.row.status|JudgState}}
{{scope.row.score|filteringDigital}}
{{scope.row.createdTime|dateFmt(‘YYYY-MM-DD HH:mm:ss’)}}

操作

详情

<mu-list-item button [@click](/user/click)=“openSimpleDialog”>
删除

确认删除此反思
<mu-button slot=“actions” flat color=“primary” [@click](/user/click)=“deleteBlog(scope.row.id)”>删除
<mu-button slot=“actions” flat color=“primary” [@click](/user/click)=“closeSimpleDialog”>取消

{{scope.row.iron}}

sort: {
name: ‘’,
order: ‘asc’
},
columns: [
{ title: ‘题目’, width: 460, name: ‘title’, sortable: false },
{ title: ‘状态’, name: ‘status’, width: 80, align: ‘center’, sortable: false },
{ title: ‘评分’, name: ‘score’, width: 180, align: ‘center’, sortable: true },
{ title: ‘提交时间’, name: ‘createdTime’, width: 140, align: ‘center’, sortable: false },
{ title: ‘操作’, name: ‘protein’, align: ‘center’, sortable: false }
]

handleSortChange ({name, order}) {
this.list = this.list.sort((a, b) =>
order === ‘asc’ ? a[name] - b[name] : b[name] - a[name]);
},

回到顶部