Making a simple TODO single page web app using VueJS.

Search for a command to run...

Hey, that's a good start, Vue.js is really neat. Thank you for the post! If you are looking for more javascript beginner projects I might have something to help you developing your javascript skills :)
Hello Simon Holdorf, Thanks for sharing the article about javascript. Its really good and insightful, looking forward to reading more from you. Let's connect on my Twitter @amaancodes ๐๐จโ๐ป
Amaan Ahmad sure, let's do it
Hey there! Are you feeling stuck in the crowd? Then I've gotta way out! ๐ There is no alternative to hands-on for succeeding as a developer! basic must-knows googling the stuff you don't know that's the most basic thing to know first, as a develo...

Let's make your web app blazing fast!

The world is developing rapidly with rapid improvements in technology. In this fast-moving world, we the developers also need to tie our shoes tight to focus on running faster! ๐โโ๏ธ๐ฅ Today, I'm talking about the serverless architecture that will he...

What? ๐ค AWS recently released Amplify Admin UI, which enables you to seamlessly create back-end and cloud databases for your next project! Supported for: web, android, iOS Support for Android: Java, Kotlin Support for iOS: SwiftUI Frameworks suppor...

Hey! I made a TODO web app just for trying out VueJS, with not so cool design. But it's okay for me, as an experiment.
This is what I created ๐จโ๐ป

Create these three files:
Things wrapped in {{ }} are data coming from the Vue app component.
v-bind:class binds to see if the state is true, then it sets the class.
v-on:click attaches an event listener to the button.
v-for iterates over an array of "todos" present in the data object of the Vue app.
<div class="container">
<div id="app">
<h2>{{title}}</h2>
<ol type="1">
<li v-for="todo in todos">{{ todo }}</li>
</ol>
<br />
<input v-bind:class="{'text-warn': shouldWarn}" v-model="newTodo" />
<button v-on:click="createNewTodo">Add</button>
</div>
</div>
body {
margin: 0;
padding: 0;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
li {
margin: 0;
padding: 0;
}
.container {
margin: 0 10vw;
}
.text-warn {
border: 2px solid red;
}
In the below example, el:"#app" sets the initialized Vue app to the DOM element with id="app"
var app = new Vue({
el: "#app",
data: {
title: "My Todo List",
shouldWarn: false,
newTodo: "",
todos: ["Learn Vue", "Learn CI/CD", "Eat dinner", "Play GTA V"],
},
methods: {
createNewTodo: function () {
if (this.newTodo) {
this.todos.push(this.newTodo);
this.newTodo = "";
this.shouldWarn = false;
} else {
console.log("newTodo doesn't exists.");
this.shouldWarn = true;
}
},
},
});
PS: you can fork the GitHub repo, and try styling it, and use localStorage() for storing the todos.
See ya! ๐
Article Cover credits: Andre Madarang's video thumbnail: Vue.js Todo App - Basics - Part 1