使用 pinyin-pro 包,十分简单 安装 npm install pinyin-pro 代码 import { pinyin } from 'pinyin-pro'; const cities = ['北京', '深圳', '上海', '广州', '杭州'