lesson 17: data inside the Vue app

This commit is contained in:
Andreas Zweili 2021-01-18 16:27:26 +01:00
parent b34a75e338
commit e594f717c5
1 changed files with 4 additions and 3 deletions

View File

@ -3,7 +3,8 @@
const app = Vue.createApp({
data() {
return {
courseGoal: "Finish the course and learn Vue.",
courseGoalA: "Finish the course and learn Vue!",
courseGoalB: "Master Vue and build amazing apps!",
vueLink: "https://vuejs.org",
};
},
@ -11,9 +12,9 @@ const app = Vue.createApp({
outputGoal() {
const randomNumber = Math.random();
if (randomNumber < 0.5) {
return "Learn Vue!";
return this.courseGoalA;
} else {
return "Master Vue!";
return this.courseGoalB;
}
},
},