fix[complex-table]: form header sort icon is out of sync (#2382)
This commit is contained in:
parent
c8039a5ce3
commit
46cc375d0d
|
@ -35,7 +35,7 @@
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
@sort-change="sortChange"
|
@sort-change="sortChange"
|
||||||
>
|
>
|
||||||
<el-table-column label="ID" prop="id" sortable="custom" align="center" width="80">
|
<el-table-column label="ID" prop="id" sortable="custom" align="center" width="80" :class-name="getSortClass('id')">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.id }}</span>
|
<span>{{ scope.row.id }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -375,6 +375,14 @@ export default {
|
||||||
return v[j]
|
return v[j]
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
},
|
||||||
|
getSortClass: function(key) {
|
||||||
|
const sort = this.listQuery.sort
|
||||||
|
return sort === `+${key}`
|
||||||
|
? 'ascending'
|
||||||
|
: sort === `-${key}`
|
||||||
|
? 'descending'
|
||||||
|
: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue