diff --git a/basics-05-using-the-native-event-object/app.js b/basics-05-using-the-native-event-object/app.js index 503a2c1..e47cc51 100644 --- a/basics-05-using-the-native-event-object/app.js +++ b/basics-05-using-the-native-event-object/app.js @@ -5,13 +5,15 @@ const app = Vue.createApp({ name: "", }; }, - methods: { - outputFullName() { + computed: { + fullName() { if (this.name === "") { return ""; } return this.name + " " + "Muster"; }, + }, + methods: { setName(event) { this.name = event.target.value; }, diff --git a/basics-05-using-the-native-event-object/index.html b/basics-05-using-the-native-event-object/index.html index b75664c..625f97d 100644 --- a/basics-05-using-the-native-event-object/index.html +++ b/basics-05-using-the-native-event-object/index.html @@ -22,7 +22,7 @@

Result: {{ counter }}

-

Your Name: {{ outputFullName() }}

+

Your Name: {{ fullName }}