3 Star 11 Fork 7

Kevin / vue2-vant-template

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

vue2-vant-template

项目简介

Vue2 Vant Template,基于Vue2 + Vue Router + Vuex + Vant等技术,实现的适配手机的开源免费模板,可用来快速开发H5应用。

特性

  • Vue Cli4,初始化项目
  • ESlint + Prettier,格式化和美化代码
  • Git Hook,验证git代码提交,禁止提交未格式化的代码
  • 支持多环境打包发布
  • Viewport,vw自适应方案
  • Vue,类似View,构建用户界面的渐进式框架
  • Vue Router,Vue路由
  • Vuex,Vue状态管理库
  • Vuex Persistedstate,Vuex状态持久化
  • Vant,移动端UI组件库
  • Sass,Dark Sass
  • moment,日期格式化
  • easytimer,简单定时器
  • store2,Better LocalStorage
  • crypto-js,加解密
  • axios,网络请求
  • async-validator,异步验证表单请求
  • accounting,金额格式化
  • compression-webpack-plugin,打包Gizp压缩
  • script-ext-html-webpack-plugin,按模块打包
  • autoprefixer,css前缀
  • babel-plugin-import,按需引入
  • babel-plugin-dynamic-import-node,动态引入,懒加载

预览

演示地址:https://skysong.gitee.io/vue2-vant-template

Project setup

yarn install

Compiles and hot-reloads for development

yarn dev

Compiles and minifies for production

yarn build

Lints and fixes files

yarn lint

指定环境打包

yarn build:test
yarn build:uat
yarn build:prod

编码规范

1、全局通用组件放在/src/components目录

2、业务组件放在./components目录

3、文件夹,使用camelCase命名格式

4、*.vue文件使用PascalCase命名格式,index.vue除外

5、属于类的*.js文件,使用PascalCase命名格式,index.js除外

6、属于Api的*.js文件,统一加上Api后缀,使用camelCase命名格式

7、其他类型的*.js文件,使用camelCase命名格式

8、样式文件、图片文件等,使用kebab-case命名格式

9、api模块和view模块,一一对应

10、方便记忆规则和项目开发

CSS

BEM:就是块(block)、元素(element)、修饰符(modifier)

.block{}
.block__element{}
.block--modifier{}

.block 代表了更高级别的抽象或组件。
.block__element 代表.block的后代,用于形成一个完整的.block的整体。
.block--modifier代表.block的不同状态或不同版本
MIT License Copyright (c) 2021 Kevin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Vue2 Vant Template,基于Vue2 + Vue Router + Vuex + Vant等技术,实现的适配手机的开源免费模板,可用来快速开发H5应用。 展开 收起
JavaScript 等 5 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/skysong/vue2-vant-template.git
git@gitee.com:skysong/vue2-vant-template.git
skysong
vue2-vant-template
vue2-vant-template
master

搜索帮助