From b34a75e3381f0fb8854c306b043fe09a95075970 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 18 Jan 2021 16:22:14 +0100 Subject: [PATCH] lesson 16 functions --- basics-01-starting-code/app.js | 10 ++++++++++ basics-01-starting-code/index.html | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/basics-01-starting-code/app.js b/basics-01-starting-code/app.js index e814851..e924058 100644 --- a/basics-01-starting-code/app.js +++ b/basics-01-starting-code/app.js @@ -7,6 +7,16 @@ const app = Vue.createApp({ vueLink: "https://vuejs.org", }; }, + methods: { + outputGoal() { + const randomNumber = Math.random(); + if (randomNumber < 0.5) { + return "Learn Vue!"; + } else { + return "Master Vue!"; + } + }, + }, }); app.mount("#user-goal"); diff --git a/basics-01-starting-code/index.html b/basics-01-starting-code/index.html index 7772f0b..5bb4f7d 100644 --- a/basics-01-starting-code/index.html +++ b/basics-01-starting-code/index.html @@ -17,7 +17,7 @@

My Course Goal

-

{{ courseGoal }}

+

{{ outputGoal() }}

Learn more about Vue.