lesson 16 functions
This commit is contained in:
parent
a16a00bce3
commit
b34a75e338
|
@ -7,6 +7,16 @@ const app = Vue.createApp({
|
||||||
vueLink: "https://vuejs.org",
|
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");
|
app.mount("#user-goal");
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
</header>
|
</header>
|
||||||
<section id="user-goal">
|
<section id="user-goal">
|
||||||
<h2>My Course Goal</h2>
|
<h2>My Course Goal</h2>
|
||||||
<p>{{ courseGoal }}</p>
|
<p>{{ outputGoal() }}</p>
|
||||||
<p>Learn more <a v-bind:href="vueLink">about Vue</a>.</p>
|
<p>Learn more <a v-bind:href="vueLink">about Vue</a>.</p>
|
||||||
</section>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
|
|
Reference in New Issue