Getting Started With Vue.js

Vue.js

STEP 01: First you need to install Node.js & NPM (Node Package Manager) into your computer if you haven’t already. 

Check to see if you have installed node with the following command on the Terminal / Command Prompt

node -v

STEP 02: Install vue using vue cli globally (-g) which is the easiest way to get started with Vue. 

npm install -g vue-cli

STEP 03: Initialize Vue project via Web Pack with the following command and change my-project to your project name.

vue init webpack my-project

This will ask you a series of questions

  • ? Project name (yourprojectname)  – The name must be URL friendly (no space)
  • ? Project description (A Vue.js project)
  • ? Author (SoftAuthor)
  • ? Vue build (Use arrow keys) ❯ Runtime + Compiler: recommended for most users
  • ? Install vue-router? (Y/n) ❯ Yes
  • ? Use ESLint to lint your code? (Y/n) ❯ No
  • ? Set up unit tests (Y/n) ❯ No
  • ? Setup e2e tests with Nightwatch? (Y/n) ❯ No
  • ? Should we run `npm install` for you after the project has been created? (recommended) (Use arrow keys) ❯ Yes, use NPM

Once you hit enter it will start downloading and installing dependencies which will take a minute or two

After that cd to your project 

cd yourprojectname

Then,

npm run dev 

At this stage, your project will be compiled and vue gives you the localhost address and go ahead and launch it on the browser

Comments Count: 0 0