This repository has been archived on 2021-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
2021-01-13 21:34:18 +01:00
|
|
|
"use strict";
|
|
|
|
|
2021-01-13 21:49:34 +01:00
|
|
|
Vue.createApp({
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
goals: [],
|
|
|
|
enteredValue: "",
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
addGoal() {
|
|
|
|
if (this.enteredValue !== "") {
|
|
|
|
this.goals.push(this.enteredValue);
|
|
|
|
}
|
|
|
|
this.enteredValue = "";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}).mount("#app");
|
|
|
|
|
2021-01-13 21:34:18 +01:00
|
|
|
// const buttonEl = document.querySelector("button");
|
|
|
|
// const inputEl = document.querySelector("input");
|
|
|
|
// const listEl = document.querySelector("ul");
|
|
|
|
|
|
|
|
// function addGoal() {
|
|
|
|
// const enteredValue = inputEl.value;
|
|
|
|
// const listItemEl = document.createElement("li");
|
|
|
|
// listItemEl.textContent = enteredValue;
|
|
|
|
// listEl.appendChild(listItemEl);
|
|
|
|
// inputEl.value = "";
|
|
|
|
// }
|
|
|
|
|
|
|
|
// buttonEl.addEventListener("click", addGoal);
|