[Vuejs]-Cant handle event in vue.js

0👍

try this:jsfiddle,i have run this and success.

   <div id="app" v-on:mouseover="mm">
       {{message}}
        <ul v-show="active">
             <li>Test vue</li>
        </ul>
    </div>

this is the js:

 new Vue({
  el: '#app',
   data: {
   active:true,
     message: 'Hello Vue.js!'
   },
    methods: {
            mm: function(){
                alert(1);
                this.active=!this.active;
            }
        }
 })

Leave a comment