From f7f506471fcd752751f4b302db29265d7be44010 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 18 Jan 2021 21:02:10 +0100 Subject: [PATCH] add a method to add a lastName --- basics-05-using-the-native-event-object/app.js | 6 ++++++ basics-05-using-the-native-event-object/index.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/basics-05-using-the-native-event-object/app.js b/basics-05-using-the-native-event-object/app.js index 1719f60..503a2c1 100644 --- a/basics-05-using-the-native-event-object/app.js +++ b/basics-05-using-the-native-event-object/app.js @@ -6,6 +6,12 @@ const app = Vue.createApp({ }; }, methods: { + outputFullName() { + if (this.name === "") { + return ""; + } + return this.name + " " + "Muster"; + }, 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 20453f5..b75664c 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: {{ name }}

+

Your Name: {{ outputFullName() }}