diff --git a/2021-09-04_composition-assignment-1-problem/src/App.vue b/2021-09-04_composition-assignment-1-problem/src/App.vue
index b704868..3ec6604 100644
--- a/2021-09-04_composition-assignment-1-problem/src/App.vue
+++ b/2021-09-04_composition-assignment-1-problem/src/App.vue
@@ -2,7 +2,7 @@
My Course Goal
- {{ courseGoal }}
+ {{ courseGoal }}
@@ -18,16 +18,25 @@ import { ref } from 'vue';
export default {
setup() {
const courseGoal = 'Something is written here';
- const showGoal = ref(false);
+ //const showGoal = ref(false);
+ const Goal = ref({
+ visibility: false
+ });
+ // ref way
+ //function toggleGoal() {
+ // showGoal.value = !showGoal.value;
+ // console.log(showGoal.value);
+ //}
+
+ // ref object way
function toggleGoal() {
- showGoal.value = !showGoal.value;
- console.log(showGoal.value);
+ Goal.value.visibility = !Goal.value.visibility;
}
return {
courseGoal,
- showGoal,
+ Goal,
toggleGoal
};
}