vue-tutorials icon indicating copy to clipboard operation
vue-tutorials copied to clipboard

v-on绑定的事件监听和例子的效果不太一样。

Open wangmaojiawan opened this issue 8 years ago • 3 comments

{{ message }}

var app5 = new Vue({ el: '#app-5', data: { message: 'Hello Vue.js!' }, methods: { reverseMessage: function () { this.message = this.message.split('').reverse().join('') } } }) 这个例子点击按钮以后是会触发on的监听事件但是页面还是会很快又刷新成初始化的状态了,message的内容还是正序,没有办法像例子那样可以通过这个button来回切换。

wangmaojiawan avatar Mar 25 '17 09:03 wangmaojiawan

我测试了OK啊.. 很普通的代码.. JS部分应该是没问题.. 能不能把HTML的也贴上来... 按道理来说.. 页面应该也不会刷新的才对啊..

HeZhaoyin avatar Mar 25 '17 14:03 HeZhaoyin

  • -我甚至连正常会刷新页面的input type="submit"都测试了.. 绑定click事件后.. 页面也不会刷新...

HeZhaoyin avatar Mar 25 '17 14:03 HeZhaoyin

就用的测试代码,我测试用的chrome浏览器,我是在Visual Studio里面创建了一个asp.web项目做的测试。

wangmaojiawan avatar Mar 27 '17 02:03 wangmaojiawan