1.0.2 • Published 2 years ago

vpinyin v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

描述

此方法可以将中文转换为拼音(转换后的首字母是大写)。也可以提取中文的首字母并大写。

下载

npm i vpinyin

引入

<script>
     import vPinyin from '@/components/py/index.js'
</script>    

使用

<script>
methods: {
    //方法一 中文转拼音  valueName值为 中国人
    chinesetoPinyin() {
     //调用中文转拼音的方法
      const resultPy = vPinyin.chineseToPinYin(this.valueName)
      console.log(resultPy)//ZhongGuoRen
      }
    }

    //方法二 提取首字母,并进行拼接
     firstBig() {
      const resultPy = vPinyin.chineseToPinYin(this.valueName)
      const firstBig = vPinyin.toFirstBig(resultPy)
      console.log(firstBig)//ZGR
    },

</script>    
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago