All Projects → ZhanPhty → vuecli3-less-template

ZhanPhty / vuecli3-less-template

Licence: MIT license
vuecli3+axios+vue-router+vuex项目通用模板,二次封装axios、预设less等,快速入手vuecli3

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
Vue
7211 projects
HTML
75241 projects

Projects that are alternatives of or similar to vuecli3-less-template

Amazeui
Amaze UI, a mobile-first and modular front-end framework.
Stars: ✭ 13,548 (+40954.55%)
Mutual labels:  less
Monokai
Monokai Atom Syntax theme
Stars: ✭ 226 (+584.85%)
Mutual labels:  less
Prejss
Get the power of PostCSS with plugins in your JSS styles. 🎨 Just put CSS into JS and get it as JSS object.
Stars: ✭ 238 (+621.21%)
Mutual labels:  less
React Native Css Modules
Style React Native components using CSS, PostCSS, Sass, Less or Stylus.
Stars: ✭ 207 (+527.27%)
Mutual labels:  less
Miracle Board
Just another simple and elegant status board / dashboard.
Stars: ✭ 217 (+557.58%)
Mutual labels:  less
Kit
ReactQL starter kit (use the CLI)
Stars: ✭ 232 (+603.03%)
Mutual labels:  less
Qianlong
A lively Qianlong Emperor / 一个可以撩的乾隆
Stars: ✭ 185 (+460.61%)
Mutual labels:  less
Material Colors
Colors of Google's Material Design made available to coders
Stars: ✭ 252 (+663.64%)
Mutual labels:  less
Octoprint Touchui
A touch friendly interface for a small TFT module or phone
Stars: ✭ 226 (+584.85%)
Mutual labels:  less
Ant Design Aliyun Theme
⚙ Ant Design Theme for console.aliyun.com
Stars: ✭ 237 (+618.18%)
Mutual labels:  less
Graphjs
A set of widgets for a meaningfully social web.
Stars: ✭ 212 (+542.42%)
Mutual labels:  less
Style Resources Loader
CSS processor resources loader for webpack
Stars: ✭ 214 (+548.48%)
Mutual labels:  less
Docs.influxdata.com Archive
ARCHIVE - 1.x docs for InfluxData
Stars: ✭ 234 (+609.09%)
Mutual labels:  less
Sbuttons
💡 Simple buttons you can use easily for your next project.
Stars: ✭ 207 (+527.27%)
Mutual labels:  less
Reset Css
An unmodified* copy of Eric Meyer's CSS reset. PostCSS, webpack, Sass, and Less friendly.
Stars: ✭ 244 (+639.39%)
Mutual labels:  less
Yarsk
Don't use this, use Create React App
Stars: ✭ 199 (+503.03%)
Mutual labels:  less
Admin
react+koa实现登陆、聊天、留言板功能后台
Stars: ✭ 228 (+590.91%)
Mutual labels:  less
Vue Cli4 Vant
基于vue-cli4和vant搭建的移动端开发模板
Stars: ✭ 253 (+666.67%)
Mutual labels:  less
A Journey Toward Better Style
A Journey toward better style
Stars: ✭ 245 (+642.42%)
Mutual labels:  less
Vbuild
"Compile" your VueJS components (sfc/*.vue) to standalone html/js/css ... python only (no need of nodejs). Support python components too !
Stars: ✭ 236 (+615.15%)
Mutual labels:  less

vuecli3+axios+vue-router+vuex项目通用模板

二次封装axios、预设less等、配置router、vuex 最基础的项目模板,其他插件根据需求自行添加

技术栈

vuex + vue-router + axios + less + eslint/prettier

安装运行

git clone https://github.com/ZhanPhty/vuecli3-less-template.git

cd vuecli3-template

yarn 或者 npm install

yarn serve 或者 npm run serve

命令说明

yarn serve 或者 npm run serve   // 启动开发环境

yarn build:test 或者 npm run build:test  // 打包测试环境

yarn build 或者 npm run build   // 打包生成环境

yarn lint 或者 npm run lint   //使用eslint+prettier格式化代码

vue ui   //启动图形化界面

结构目录

* dist/  --------打包文件夹
* src/  --------源代码根目录
    * assets/  --------静态资源存放
        * less/  --------预设less
            * base/  --------html初始化样式
            * common/  --------项目通用样式
            * variables/  --------less参数
            * base.less  --------页面引用文件
            * settings.less  --------配置入口文件
    * axios/  --------二次封装axios,更优雅的使用Promise
        * api/  --------api模块存放文件夹
        * config.js  --------封装axios配置
    * components/  --------模板文件
    * router/  --------router路由
        * demo/  --------配置路由demo
            * index.js  --------router.children配置
        * index.js  --------router模块统一引用入口
    * store/  --------vuex
        * demo/  --------配置vuex示例(模块化)
        * index.js  --------vuex模块统一引用入口
    * views/  --------视图
* tests/  --------单元测试
* .env.development  --------开发环境配置文件
* .env.production  --------生产环境配置文件
* .env.testing  --------测试环境配置文件
* .eslintrc.js  --------eslint配置文件
* vue.config.js  --------vuecli3配置文件

项目说明

在vue-cli3脚手架的基础上,添加了一些必要的配置文件,同时也保持最纯洁的模板,根据项目可引用其他框架。 更适合大型项目及多人协作

  • 添加了一些less参数、reset.css等
  • 对axios二次封装,可以更优雅的请求接口了
  • 对router模块化引用,方便维护
  • vuex同样模块化,分类管理

less

使用 style-resources-loader 配置全局参数

axios

封装后的axios,更优雅的使用axios

示例(@/axios/api/user.js文件下的login接口)

首先页面引用文件 import { login } from 'api/user'

调用login() login({ userid: 1234 }).then(res => { console.log(res) })

router

模块化router,对一级以下的路由(routes.children)进行分类管理

store

模块化vuex,使用官方的modules引入各个模块

  • index.js
  • state.js
  • types.js
  • actions.js
  • getters.js
  • mutations.js

vue.config.js

pluginOptions.env.TEST

自定义全局变量,打印测试console.log(process.env.TEST)

vue-cli其他配置

传送门: vue-cli3.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].