lesson 24: event modifiers the obvious way
This commit is contained in:
parent
467f1fddb1
commit
1bd8145e81
|
@ -6,6 +6,10 @@ const app = Vue.createApp({
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
submitForm(event) {
|
||||
event.preventDefault();
|
||||
alert("Submitted");
|
||||
},
|
||||
setName(event, lastName) {
|
||||
this.name = event.target.value + " " + lastName;
|
||||
},
|
||||
|
|
|
@ -22,6 +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>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
|
|
Reference in New Issue