Skip to content

zengxiaotao/vue-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#vue-py

vue 汉字转拼音插件

Usage

<script src='path/to/vue.js'></script>
<script src='path/to/vue-py.js'></script>
<body>
    <div id='app'>
        <p v-py='name'></p> <!--渲染成 <p>zhong guo</p>-->
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                name: '中国'
            }
        })
    </script>
</body>

modifiers

  1. capitalize

    <div id='app'>
        <p v-py.capitalize='name'></p> <!--渲染成 <p>ZHONG GUO</p>-->
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                name: '中国'
            }
        })
    </script>
  2. upperfirst

    <div id='#app'>
        <p v-py.upperfirst='name'></p> <!--渲染成 <p>Zhong Guo</p>-->
    </div>
    <script>
        var vm = new Vue({
            el: 'app',
            data: {
                name: '中国'
            }
        })
    </script>

demo

vue 拼音插件demo

Releases

No releases published

Packages

No packages published