VueJS使用笔记

html:

  <script src='vue.js'></script>

  <div id='app'>

    <span>{{msg}}</span>

    <input  type='text' v-model='msg2' />

    <input  type='button' v-on:click='onVerify' />

  </div>

js:

  <script>

    var app = new Vue({

      el: '#app',

      data:{

        msg: 'Hello World',

        msg2: 'sss'

      },

      methods:{

        onVerify: function(){

          if(this.msg2==''){

            alert('请输入内容');

          }

        }

      }

    });

  </script>

原文地址:https://www.cnblogs.com/gz-fenglang/p/7760806.html