vue使用 yarn添加 pinyin 组件,并转换中文为首字母缩写

1、添加   yarn add  js-pinyin

2、 初始化

import pinyin from "js-pinyin";
pinyin.setOptions({ checkPolyphone: false, charCase: 0 });
3、引用
 var temp= pinyin.getCamelChars("中文转换为字母");
posted @ 2023-01-10 10:31  orenl  阅读(363)  评论(0)    收藏  举报