当前位置:网站首页>el-table表格——sortable排序 & 出现小数、%时排序错乱
el-table表格——sortable排序 & 出现小数、%时排序错乱
2022-07-06 12:51:00 【viceen】
el-table表格——sortable排序 & 出现小数、%时排序错乱
前端实现排序
只需要在表头上加上一个sortable属性即可
<el-table-column prop="bookCount" label="图书总量" align="center" :show-overflow-tooltip="true" sortable ></el-table-column>
问题1、当数据中出现小数,导致排序错乱
解决:
<el-table-column prop="intoRate" label="进场及时率" align="center" :sort-method="(a,b)=>{return a.intoRate - b.intoRate}" :show-overflow-tooltip="true" sortable ></el-table-column>
问题2、当数据需要使用%来显示,直接返回的数据含有%导致排序错乱,需要返回正常数字,在这里进行拼接%
解决
<el-table-column prop="intoRate" label="进场及时率" align="center" :sort-method="(a,b)=>{return a.intoRate - b.intoRate}" :show-overflow-tooltip="true" sortable>
<template slot-scope="scope">
{
{ scope.row.intoRate }}%
</template>
</el-table-column>
边栏推荐
- PHP online examination system version 4.0 source code computer + mobile terminal
- Math symbols in lists
- Reviewer dis's whole research direction is not just reviewing my manuscript. What should I do?
- Common doubts about the introduction of APS by enterprises
- (work record) March 11, 2020 to March 15, 2021
- 3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
- Pycharm remote execution
- 966 minimum path sum
- 愛可可AI前沿推介(7.6)
- ICML 2022 | Flowformer: 任务通用的线性复杂度Transformer
猜你喜欢

2022 nurse (primary) examination questions and new nurse (primary) examination questions
![Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]](/img/cf/58a62a7134ff5e9f8d2f91aa24c7ac.png)
Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]

Comprehensive evaluation and recommendation of the most comprehensive knowledge base management tools in the whole network: flowus, baklib, jiandaoyun, ones wiki, pingcode, seed, mebox, Yifang cloud,

Build your own application based on Google's open source tensorflow object detection API video object recognition system (IV)

知识图谱构建流程步骤详解

Reviewer dis's whole research direction is not just reviewing my manuscript. What should I do?

Swagger UI tutorial API document artifact

Aiko ai Frontier promotion (7.6)

New database, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, Feishu multidimensional table, heipayun, Zhixin information, YuQue

监控界的最强王者,没有之一!
随机推荐
Pytest (3) - Test naming rules
2022 nurse (primary) examination questions and new nurse (primary) examination questions
New database, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, Feishu multidimensional table, heipayun, Zhixin information, YuQue
监控界的最强王者,没有之一!
Huawei device command
[DIY]自己设计微软MakeCode街机,官方开源软硬件
LLVM之父Chris Lattner:为什么我们要重建AI基础设施软件
967- letter combination of telephone number
Notes - detailed steps of training, testing and verification of yolo-v4-tiny source code
数据湖(八):Iceberg数据存储格式
拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条
[200 opencv routines] 220 Mosaic the image
Interviewer: what is the internal implementation of ordered collection in redis?
基于STM32单片机设计的红外测温仪(带人脸检测)
What is the difference between procedural SQL and C language in defining variables
APS taps home appliance industry into new growth points
[MySQL] basic use of cursor
Select data Column subset in table R [duplicate] - select subset of columns in data table R [duplicate]
Swagger UI教程 API 文档神器
How to implement common frameworks