I couldn't manage to make it work. v-on:click event is not invoking the method on Vue instance. Here is the codes:
<div id="app">
<button class="btn btn-success" v-on:click="postEventData">
<i class="icon wb-share"></i> Publish
</button>
</div>
Vue instance:
var vm = new Vue({
el: '#app',
data: {
someData: 'fooBar'
},
methods: {
postEventData: function () {
axios.post('/foobar', vm._data);
}
}
});
Any help would be appreciated!
v-on:clickis getting called just fine. Look at this fiddle for example fiddle.jshell.net/v1qpt8d8/1thisin yourpostEventDatamethod, notvm