码迷,mamicode.com
首页 > Web开发 > 详细

VueJS使用笔记

时间:2017-10-31 14:23:51      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:fun   ejs   内容   put   eth   data   methods   ext   alert   

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>

VueJS使用笔记

标签:fun   ejs   内容   put   eth   data   methods   ext   alert   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!