How to use the pinyin conversion plug-in in a vue project
0) {I1 = I1.replace ('- -','-')} return I1}, arraySearch: function (L1) {for (var name in pinyin) {if (pinyin [name] .indexOf (L1)! =-1) {return this.ucfirst (name)}} return false}, ucfirst: function (L1) {if (l1.length > 0) {var first = l1.substr (0,1). ToUpperCase () var spare = l1.substr (1) L1.length) return first + spare}} 3. The project uses # to introduce the Chinese character conversion pinyin plug-in file import vPinyin from'.. / utils/vue-py'let salesmanName = 'Zhang San' # call the Chinese character conversion pinyin method let namePinyin = vPinyin.chineseToPinYin (salesmanName) above is all the content of this article "how to use the pinyin conversion plug-in in the vue project". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.