VueJs - Getting Started

Web Developer | React.js | JavaScript | Check out my blog: https://blog.eligarlo.dev
Search for a command to run...

Web Developer | React.js | JavaScript | Check out my blog: https://blog.eligarlo.dev
Thanks Hillel, stay tuned!
This series is a beginner friendly tutorial to start with vue.js the javascript framework.
Hi vue and welcome to VueJs, The Series π Spoiler alertπ¨: In case you missed VueJs - Getting Started go and check it out. What is Interpolation? When we talk about interpolation, aka "String Interpolation", we talk about the "Mustache" syntax we...
React is a popular JavaScript library that provides developers with a powerful and efficient way to build user interfaces. One of the key features of React is the ability to use a method called createPortal to render components outside the main conte...

For a good work-life balance, stay active and healthy.

A few days ago I decided it was time for me to update myself to the new version of Vuejs, Vue 3. And today I wanted to share with you the first thing I learn that version two didn't have, the teleport component. It's well known that modern web applic...

Definition of trim, "To cut away unnecessary parts from something." - Oxford Dictionary. Sometimes, validating forms in JavaScript can be a tedious task for a developer. You have to check many things. For instance, that the values given are of the t...

We always have to validate if the arguments passed in a function have a value or they are undefined but, do we really? Introduction In my last post, I talked about Destructuring Assignment In A Function Parameter and why it is handy when you have opt...

βTo get started with Vue, all you need is familiarity with HTML and JavaScript. With these basic skills, you can start building non-trivial applications within less than a dayβ- VueJs Docs
In this first episode we are going to cover the following topics:
We have a few different ways to install vue as you can see here but for the purpose of this tutorial I'll be using CDN.
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
Don't use this CDN for production.
We will need an index.html and app.js files.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- VueJs Import -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<title>VueJs - Getting Started</title>
</head>
<body>
<div id="app">
<h1>{{ title }}</h1>
</div>
<script src="app.js"></script>
</body>
</html>
Your index.html should look like this β
Let's go over 2 and 3 for a second:
Your app.js should look like this π
new Vue({
el: "#app",
data: {
title: "Hello World!"
}
})
Hold your ππ, WHAT?
We created our Vue instance with new Vue() that takes an object as an argument.
Then we have the el and data properties. All properties (there are more and we will see them in this series) have reserved names that Vue will recognize.
In the el property we need to pass the html element that we want the Vue instance to take control.
In the data property we store all the data we want to use in our Vue instance. Think of the properties store inside the data object as variables, you can have strings, booleans, arrays...
In our case the data property is the string Hello world, very creative right?
Ok, so let's open our html file and see what we got there.

Congratulations, we created our first VueJs app! ππ₯³
In this episode we covered the following:
{{ }} syntax.el and data properties.TODO: Build this Hello World app by your own but this time instead of using a CDN, installing Vue in a different way.
Here is again the link for the other installation options.
GitHub repo for the code used in this episode.
Did you enjoy this article? Don't be selfish, go on and share the knowledge!
You can also find me on Twitter @eligarlo.