lesson 17: data inside the Vue app
This commit is contained in:
parent
b34a75e338
commit
e594f717c5
|
@ -3,7 +3,8 @@
|
||||||
const app = Vue.createApp({
|
const app = Vue.createApp({
|
||||||
data() {
|
data() {
|
||||||
return {
|
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",
|
vueLink: "https://vuejs.org",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -11,9 +12,9 @@ const app = Vue.createApp({
|
||||||
outputGoal() {
|
outputGoal() {
|
||||||
const randomNumber = Math.random();
|
const randomNumber = Math.random();
|
||||||
if (randomNumber < 0.5) {
|
if (randomNumber < 0.5) {
|
||||||
return "Learn Vue!";
|
return this.courseGoalA;
|
||||||
} else {
|
} else {
|
||||||
return "Master Vue!";
|
return this.courseGoalB;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Reference in New Issue