Skip to content

Instantly share code, notes, and snippets.

@OHua
Last active August 4, 2019 16:49
Show Gist options
  • Save OHua/6464dff10d52c307e0aafb476b22d287 to your computer and use it in GitHub Desktop.
Save OHua/6464dff10d52c307e0aafb476b22d287 to your computer and use it in GitHub Desktop.
構築大綱:ubuntu > nvm > node.js + npm > @vue/cli > vue.js
構築步驟:
1. install nvm from it's github repository
2. install node.js by nvm and get npm at the same time
3. use npm to install vue-cli
4. use vue-cli to construct vue.js MVVM
步驟細節:
sudo apt-get update
sudo apt-get install build-essential libssl-dev
curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh
# go check https://github.com/nvm-sh/nvm for detail
source ~/.profile
# nvm --version
nvm install node
# node -v
# npm -v
npm serch @vue/cli
npm install -g @vue/cli
# you should use "-g" global install vue-cli and http-server
# then it will installed in ~/.nvm/versions/node/v12.7.0/lib/ as we wanted
# npm list -g
vue ui
vue create MyProjectName
npm run serve
npx vue-cli-service serve --https
npm run build --modern
前後端分離:
emacs vue.config.js
module.exports = {
outputDir: '../templates',
assetsDir: '../static',
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment