Saturday, January 12, 2019

Install Vue

Install NVM (Node Version Manager):

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/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 10.15.0

Use a certain version of node:

$ nvm use 10.15.0

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: