--- tags: VUE --- 【VUE】Vue-cli 安裝與資料夾 === [看看Guide](https://cli.vuejs.org/zh/guide/) https://github.com/vuejs/vue-cli ### 1. 安裝 ``` npm install -g @vue/cli # OR yarn global add @vue/cli # check version vue --version ``` ##### 更新 ``` # upgrade npm update -g @vue/cli # OR yarn global upgrade --latest @vue/cli ``` ### 2. 創建 [建立Guide](https://cli.vuejs.org/zh/guide/creating-a-project.html#vue-create) ``` vue create hello-world ``` ### 3. 模版 [vue templates](https://github.com/vuejs-templates) ``` vue init <template> <app-name> # 例子 vue init webpack my-project ``` ### 檔案說明 - src - main.js: 進入點 - static: 靜態資源,不會編譯 - build: webpack config - config: 設定檔 ### build資料夾 #### - webpack.base.conf.js # Vue組成 - xtemplate - javascript - style # 相關連結 Vue Router https://router.vuejs.org/zh-cn/ Axios https://github.com/axios/axios Vue Axios https://www.npmjs.com/package/vue-axios