vue 中对城市列表根据首字母进行排序 BG7ZAG | 2018-12-14 11:11 | 1,862 | 0 | 程序开发 74 字 | 3 分钟 vue中根据城市的首字母a-z进行排序 先安装 js-pinyin 依赖: npm i --save js-pinyin 然后在组件中引入: import pyjs from 'js-pinyin' export default { async mounted() { let city = [ { name: '北京' }, { name: '上海… JavaScriptjsVue城市列表排序