Saturday, August 11, 2018

Install Vue

Install NVM (Node Version Manager):

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

Note: You need to logout and log back in.

List the available node versions:

$ nvm ls-remote

Install a node version:

$ nvm install 8.11.3

Use a certain version of node:

$ nvm use 8.9.3

Check node version:

$ node -v

List installed node versions:

$ nvm ls

Install Vue:

$ npm install -g @vue/cli

Create a Vue project:

$ vue create my_project

Switch to the project and add more tools:

$ cd my_project
$ npm install vue-axios axios iview --save
$ npm install js-beautify --save-dev

Add the following lines under "scripts" key:

$ vim package.json

"scripts": {
    "build": "vue-cli-service build --mode production",
    "watch": "vue-cli-service build --mode development --watch",
},

Set up some Vue configuration:

$ vim vue.config.js

module.exports = {
    baseUrl: '/dist/',
    outputDir: 'dist',
    runtimeCompiler: true,
};

Install a hot reload tool to run Go application:

$ go get -u github.com/oxequa/realize
$ realize init

Start realize:

$ realize start

No comments: