liuxiaoyucc / xy-blog

:book: 使用hexo搭建的静态博客 http://blog.pulsating.cn/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JS实现首字母排序 | cc&xy

liuxiaoyucc opened this issue · comments

commented

http://www.pulsating.cn/2019/11/22/JS%E5%AE%9E%E7%8E%B0%E9%A6%96%E5%AD%97%E6%AF%8D%E6%8E%92%E5%BA%8F/

前言一个按照姓名首字母排序的功能,支持数字,字母,符号,中文混合排序 规则 首字为中文则转换成小写 大小写均转换成小写比较,避免任意大写字母排在任意小写字母前 大写字母 == 小写字母 > 数字 > 符号 (这里数字和符号可以在最前面,因为业务需要被我拿到了最后面) 效果12345678910111213141516171819202122// 排序前this.friends =