我在使用Laravel 5.4的vue2中遇到事件处理问题 - 当我在按钮上使用click事件时没有任何反应。没有错误或其他任何内容。
我的HTML(实际上是 header.blade.php ):
<div id="example">
<button v-on:click="exclick">Super btn</button>
</div>
我的js(资源/资源文件夹中的 app.js )
require('./bootstrap');
new Vue({
el: '#example',
methods: {
exclick: function (event) {
alert("Log 1");
if (event) {
alert("Log 2");
}
}
}
});
const app = new Vue({
el: '#app'
});
由gulp编译的JS
请帮忙!