我实验了一下,或许能力不够,没有成功获取排序后的table数组数据,只能获取当前数据与比较数据;
:default-sort = "{prop: 'date', order: 'descending'}"
>
type="selection"
width="55"
>
prop="date"
label="日期"
:sort-method="changesort"
sortable
>
prop="name"
label="姓名"
>
prop="address"
label="地址"
>
export default{
method(){
changesort(a,b){
let oldTime= (new Date(a.date)).getTime()/1000;
let newime= (new Date(b.date)).getTime()/1000;
if(oldTime-newime>0){
// console.log(b.date)
return true;
}else{
console.log(b.date)
return false;
}
}
}
}