8000 GitHub - MissionVistaCS/Vue.js-Tutorial at 096dfd6fce12087068b35c3300924f42701e7908
[go: up one dir, main page]

Skip to content

MissionVistaCS/Vue.js-Tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 

Repository files navigation

Vue.js Tutorial

A short, concise tutorial on the popular front-end framework Vue.js. Written for the Mission Vista High School Web Programming course. Not every directory in the repo will be accounted for here... make sure to poke around in the repo for more information

Table of Contents

  1. Getting Started

  2. Basics

  3. Resources

Getting Started

Vue.js is the Javascript framework. In this section, we will start off with installing and getting exposed to Vue.js

Installation and Usage

Vue.js is tremendously simple to install and use. Although we will be using the Vue command line interface (vue-cli), you can get started with Vue in 3 different ways.

CDN: To Github Section

Import Vue.js into your index.html file using the <script> tag.

<!-- development version with alarms and alerts -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

NPM: To Github Section

Start by creating a project with npm

	$ npm init -y

Install Vue and save dependencies

	$ npm install -s vue

Then in your index.html file reference vue with a <script> tag

<body>
	<script src="node_modules/dist/vue/vue.js"></script>
</body>

* As a note: in the /dist folder of the vue npm package, there are many other versions that refer to different builds of Vue.js. We will only be using the Full build. For more information see here

Vue-CLI: To Github Section

This is the method we will most often use. The Vue-CLI allows us to quickly create Single Page Applications with built in templates. Start by installing the Vue-CLI module from NPM

	$ sudo npm install -g vue-cli

Create your project using the CLI with the command vue init <template-name> <project-name>
Ex:

	$ vue init webpack-simple myFirstVueProject

JSFiddle:
You can play around with Vue.js in JSFiddle's Hello World Example

Basics

In this section, we will learn about the basics of Vue: basic directory structure, syntax, and v-directives.

Syntax

Vue.js has special syntax. In this section, we discover interpolations and basic data bindings related to Vue.js.

Basic Directory Structure

V-Directives

Vue.js uses an attribute called v-directives, similar to Angular's ng-directives. They allow us to retrieve, bind, show, and other actions to our data. With every new v-directive demonstrated, make sure to test out its data binding by trying it out in the console.

Declarative Rendering: To Github Section
Declarative Rendering basically means that Vue.js hooks up the data from our <script> tag to the DOM. To prove this, run the provided example and in the browser console type:

app.message

This should output:

Hello Vue! 

You can also set the data of your Vue app and it will update reactively.

app.message = "Vue is cool!"

This should dynamically change the webpage.

Resources

Vue.js is one of the better documented frameworks out there. Regardless, I have compiled a list of my favorite Vue.js documentations/tutorials while writing this tutorial.

About

A simple Vue.js tutorial for the Mission Vista Web Programming Course

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0