当前位置:网站首页>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>
边栏推荐
- 3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
- Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission
- Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
- [DIY]自己设计微软MakeCode街机,官方开源软硬件
- Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]
- PHP online examination system version 4.0 source code computer + mobile terminal
- 2022 construction electrician (special type of construction work) free test questions and construction electrician (special type of construction work) certificate examination
- Leetcode hot topic Hot 100 day 32: "minimum coverage substring"
- Reviewer dis's whole research direction is not just reviewing my manuscript. What should I do?
- 硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
猜你喜欢
基于STM32单片机设计的红外测温仪(带人脸检测)
知识图谱构建流程步骤详解
数据湖(八):Iceberg数据存储格式
1_ Introduction to go language
面试官:Redis中有序集合的内部实现方式是什么?
MLP (multilayer perceptron neural network) is a multilayer fully connected neural network model.
【深度学习】PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
3D人脸重建:从基础知识到识别/重建方法!
防火墙基础之外网服务器区部署和双机热备
Core principles of video games
随机推荐
[DSP] [Part 1] start DSP learning
基于STM32单片机设计的红外测温仪(带人脸检测)
Can novices speculate in stocks for 200 yuan? Is the securities account given by qiniu safe?
【微信小程序】運行機制和更新機制
js中,字符串和数组互转(一)——字符串转为数组的方法
Kubernetes learning summary (20) -- what is the relationship between kubernetes and microservices and containers?
强化学习-学习笔记5 | AlphaGo
R language visualizes the relationship between more than two classification (category) variables, uses mosaic function in VCD package to create mosaic plots, and visualizes the relationship between tw
Word bag model and TF-IDF
Laravel笔记-自定义登录中新增登录5次失败锁账户功能(提高系统安全性)
Spiral square PTA
自定义限流注解
PG基础篇--逻辑结构管理(事务)
Pycharm remote execution
请问sql group by 语句问题
How to upgrade high value-added links in the textile and clothing industry? APS to help
[DIY]自己设计微软MakeCode街机,官方开源软硬件
Opencv learning example code 3.2.3 image binarization
拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条
Reinforcement learning - learning notes 5 | alphago