Code Monkey home page Code Monkey logo

vue2-spa-template's Introduction

基于Vue2+ElementUi的单页面项目模板

技术栈

  • vue v2: vue全家桶
  • axios: 基于promise的HTTP库
  • dayjs: 完美替代momentjs的轻量级时间处理库
  • element-ui: 基于Vue2的桌面端组件库

项目架构

├─public 静态文件
│  ├─index.html 单页面入口文件 
├─src 开发目录
│  ├─requests ajax请求管理  
│  ├─configs 配置项 
│  ├─assets 静态资源目录 
│  ├─components 公共组件
│  ├─layouts 布局组件
│  ├─main.js 入口文件
│  ├─pages 页面组件 
│  ├─plugins 插件管理 
│  ├─router 路由目录 
│  ├─store vuex管理 
│  │  ├─index.js 入口文件
│  │  ├─state.js
│  │  ├─getters.js
│  │  ├─mutations.js
│  │  ├─actionTypes.js
│  │  ├─actions.js
│  ├─utils 工具方法目录
│  ├─filters 过滤器
│  ├─app.vue 根组件
│  ├─main.js 项目入口文件
├─.env.development 开发环境模式和变量配置
├─.env.production 正式环境模式和变量配置
├─.env.test 测试环境模式和变量配置
├─.eslintrc.js ESLint配置
├─babel.config.js babel配置
├─package.json npm包版本
├─vue.config.js webpack配置
    

项目运行

clone项目

git clone https://github.com/sanjings/vue2-spa-template.git

安装依赖(推荐使用pnpm)

npm i pnpm -g
cd vue2-spa-template
pnpm install

本地运行测试环境

yarn dev or npm run dev

本地运行生产环境

yarn dev:prod or npm run dev:prod

测试环境打包

yarn test or npm run test

生产环境打包

yarn build or npm run build

如需更多环境的,直接在根目录下配置.env.XXX(环境名称),然后在package.json的scripts中配置即可

最后

项目架构是我个人的开发习惯,仅供参考,喜欢就赏个⭐吧,谢谢支持

vue2-spa-template's People

Contributors

sanjings avatar

Stargazers

 avatar li feng avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.