1 Star 0 Fork 0

Funren/base-vue2+commitizen

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

VUE2 单页应用 基础配置

  • base-vue2 是采用 Vue2 全家桶搭建基础项目

介绍

移动端css适配

  • 已配置移动端适配,px 自动转 viewport 单位;(注意行内样式中px无法转换)
  • 可在 postcss.config.js 文件中修改设计稿尺寸,默认尺寸375;

scss 全局变量配置

  • 所有scss全局变量配置文件,需放置到 src/style 文件夹中。
  • src/style 中所有 .scss 文件中scss变量将自动注入到全局,项目中可直接使用,无需import;

vuex 配置

  • 已拆分为单文件管理。
  • mutation-type 用于管理函数名。

axios 配置

  • 已对 axios 的 get、post 进行二次封装;
使用方法
//api/index.js

//引入 axios 二次封装的 get、post 方法
import {get,post} from './common/http';

//封装项目中 ajax 请求
export const getList=get('http://www.xxx.com/api');
// views/Home.vue

// 项目中使用
import {getList} from '@api/index'
export default {
    mounted(){
       getList({
          'uid':'0001',
       })
    }
}

poxry 配置

  • 已配置 poxry 代理
使用方法
  1. 配置API接口地址:
//api/common/url.js
//支持多域名

module.exports={
    // key(自定义关键字): value(代理域名)
    // key 值用于开发环境中 proxy 代理拦截
    // value 值用于生产环境中使用

    'API':'https://www.xxx.com',
    'MZL':'https://www.uuu.com',
}
  1. 使用接口地址:
//api/index.js

// 引入二次封装的 axios 方法;
import {get,post} from './common/http';

// 引入 auto.url.js 模块,获取动态生成的API接口url地址
import URL from './common/auto.url';
const {API,MZL}=URL;

// get 请求中使用
export const getList=get(API+'/api');

commitizen 规范 git 提交

使用方法
  • 提交修改:使用 git cz 替换 git commit 所有操作
git cz
git push
  • 生成 changelog 与 tag
npm run release
git push --tags
MIT License Copyright (c) 2021 Funren 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 基础配置 + commitizen 规则验证 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/funren/base-vue2-commitizen.git
git@gitee.com:funren/base-vue2-commitizen.git
funren
base-vue2-commitizen
base-vue2+commitizen
master

搜索帮助