Giter Site home page Giter Site logo

damomhd / vue-starter-template Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.68 MB

vue入门配套移动端脚手架:基于vue-cli4.0+webpack 4+vant ui + sass+ rem适配方案+axios封装 +mock/gulp热更新

JavaScript 61.03% Batchfile 0.03% HTML 1.82% Vue 32.70% CSS 1.34% Shell 0.08% Less 2.99%
vue mock-server vant-ui vuex vue-cli-4

vue-starter-template's Introduction

  • Vue-cli4
  • Vue-router
  • Vuex
  • 多环境变量
  • rem适配 px自动转rem
  • Vant按需加载
  • Less、Sass全局样式
  • 配置cz git提交基于angular规范校验
  • webpack根据特定文件夹自动生成雪碧图
  • Axios全局拦截、支持防止多次重复请求
  • 请求接口管理
  • 配置打包分析
  • 配置externals引用cdn资源
  • 配置alias别名
  • 去除console.log
  • Eslint
  • 支持mock服务,实时热更新
  • splitChunks提取公共模块

test

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Run your tests

npm run test

Lints and fixes files

npm run lint

Customize configuration

See Configuration Reference.

【前端公虾米】

解决移动端300ms延迟

cnpm install fastclick -S
在main.js中引入fastClick和初始化:

import FastClick from 'fastclick'; // 引入插件
FastClick.attach(document.body); // 使用 fastclick

Gitmoji Commit 演示

解决cli3 热更新慢

npm install babel-plugin-dynamic-import-node --save-dev

在.babelrc添加

{
    "env": {
        "development": {
            "plugins": [
                "dynamic-import-node"
            ]
        }
    }
}

terser-webpack-plugin替代uglifyjs-webpack-plugin

因为uglifyjs不支持es6语法

yarn add terser-webpack-plugin -D

mock 模拟数据服务接入

json-server 搭配 mock.js

npm install json-server mockjs --save

mock改动自动热更新

npm install gulp gulp-nodemon browser-sync --save

使用Angular提交规范 构建提交校验规范

使用git cz使用

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.