- 基于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