会员
周边
新闻
博问
融资
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
shuihanxiao
博客园
首页
新随笔
联系
管理
订阅
获取汉字首字母,拼音,可实现拼音字母搜索----npm js-pinyin
npm install js-pinyin
main.js 引入
import pinyin from 'js-pinyin'
使用组件内
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
'
)
)
;
posted @
2018-09-27 16:31
shuihanxiao
阅读(
3909
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
公告