lesson 24: event modifiers the proper way
This commit is contained in:
parent
1bd8145e81
commit
e1524b4661
|
@ -6,8 +6,7 @@ const app = Vue.createApp({
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
submitForm(event) {
|
||||
event.preventDefault();
|
||||
submitForm() {
|
||||
alert("Submitted");
|
||||
},
|
||||
setName(event, lastName) {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<p>Result: {{ counter }}</p>
|
||||
<input type="text" v-on:input="setName($event, 'SomeOtherINput')">
|
||||
<p>Your Name: {{name}}</p>
|
||||
<form v-on:submit="submitForm"><input type="text"><button>Sign Up</button></form>
|
||||
<form v-on:submit.prevent="submitForm"><input type="text"><button>Sign Up</button></form>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
|
|
Reference in New Issue