- 基於Vue全家桶 + axios + typescript + element-ui + scss + webpack4構建的企業級應用項目;
- 開發時請確保你已瞭解或掌握以上技術要求,而後你就能夠愉快的玩耍了;
baseUrl
和 NODE_ENV
其餘環境變量使用 VUE_APP 開頭local
,你能夠在項目拉取下來後補充 .env.development.local
文件,並添加以下信息並替換你本身所在服務器的域名及端口;例如 : NODE_ENV='development' VUE_APP_URL='http://localhost:8080'css
- data
- @Prop
- @State
- @Getter
- @Action
- @Mutation
- @Watch
- 生命週期鉤子
- beforeCreate(按照生命週期鉤子從上到下)
- created
- beforeMount
- mounted
- beforeUpdate
- updated
- activated
- deactivated
- beforeDestroy
- destroyed
- errorCaptured(最後一個生命週期鉤子)
- 路由鉤子
- beforeRouteEnter
- beforeRouteUpdate
- beforeRouteLeave
- computed
- methods
- 組件引用,mixins,filters 等放在 @Component 裏面
複製代碼
src:項目源碼。開發的時候代碼寫在這裏。
|--api # 服務層ajax請求服務
| |--index # api數據入口文件
|--assets # 項目靜態資源
|--axios # axios封裝請求//攔截配置
| |--config.ts # axios攔截器配置文件
| |--service,ts # axios請求配置文件
|--components # 項目公共組件庫
|--router # 項目路由
| |--index.ts # 入口及路由初始化
| |--filterRouter # 頁面路由文件
|--store # 基於Vuex的狀態管理模塊
| |--index.ts # 入口及store初始化
| |--modules # 子模塊的store對象
|--utils # 公共庫函數
|--views # 項目應用頁面,根據應用須要,還能夠有子頁面,各子頁面目錄結構和頂級子頁面相似
|--App.vue # 項目根視圖
|--main.ts # 項目入口文件
複製代碼
$ git clone git@github.com:Echi1993/vue-cli3-template.git
$ cd vue-cli3-template
$ npm install
$ npm run serve # 訪問 http://localhost:8080
$ npm run build # Compiles and minifies for production
$ npm run lint # Lints and fixes files
$ npm run test:unit # Run your unit tests
複製代碼
現代瀏覽器及 IE11。vue
有興趣的能夠查看個人githubwebpack
本文做者: Echi
本文連接: juejin.im/user/585e36…
版權聲明: 本文章除特別聲明外,均採用 @BY-NC-SA 許可協議。轉載請註明出處!ios