jiuyiUniapp/jiuyi2/node_modules/js-pinyin/README.md

27 lines
753 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 汉字转拼音
把汉字转化为拼音字母,由[chinalu/JSPinyin](https://github.com/chinalu/JSPinyin)改写使用新语法并去掉mootools的依赖
## 安装
```base
npm install js-pinyin
import pinyin from 'js-pinyin'
```
## 使用示例
```js
let pinyin = require('js-pinyin');
pinyin.setOptions({checkPolyphone: false, charCase: 0});
console.log(pinyin.getFullChars('管理员'))
console.log(pinyin.getCamelChars('管理员'))
console.log(pinyin.getCamelChars('1234'))
console.log(pinyin.getCamelChars('english'))
console.log(pinyin.getCamelChars('昕'))
console.log(pinyin.getCamelChars('佛'))
console.log(pinyin.getFullChars('佛'))
console.log(pinyin.getFullChars('凃一二'))
console.log(pinyin.getCamelChars('凃一二'))
```