Why is the event.preventDefault()
method not functioning properly?
<script type="text/javascript" src="vue.js"></script>
<div id="app">
<form v-on:submit.prevent="saveData">
<input type="text" name="test">
<button type="submit">Go</button>
</form>
</div>
<script type="text/javascript">
new Vue({
'el': '#app',
'methods':{
'saveData': function(event){
event.preventDefault();
}
}
});
</script>