readme //项目的说明文件
package.json //第三方依赖包配置
package.lock.json //帮助我们去确定安装的第三方依赖包的具体的版本,保持团队编程的统一
license //开源协议的说明
index.html //项目默认的首页模版文件
.postcssrc.js //对 postcss 的配置项
.gitignore //不需要上传到 git 上的文件管理
.eslintrc.js //对写的代码检测是否标准做一个检测
.eslintignore //配置不需要 eslintrc 检测工具检测的文件
.editorconfig //配置编辑器总风格统一的自动化格式的语法
.babelrc //项目写的代码是 Vue 的大文件组件的代码的写法,所以需要通过 babel 这种语法解析器做一些语法上的转换,最终转换成浏览器能够编译执行的代码,babel 需要做额外配置时,就放在文件里面
static //static 目录放的是静态资源,要用到的静态图片啊或者后续需要模拟的 json 数据
node_modules //项目中需要用到的第三方 node 包
src //放的是项目的源代码
src/main.js //整个项目的入口文件
src/app.vue //整个项目最原始的根组件
src/router/index.js //项目的路由放置位置
src/components //项目中要用到的小组件
src/assets //项目中需要用到的图片
config //放置项目配置文件
config/index.js //放基础配置
js //开发环境配置信息
js //线上环境配置信息
build //放置项目打包的 webpack 配置信息,vue-cli 会自动构建
build/f.js //基础的 webpack 配置信息
build/f.js //开发环境的 webpack 配置信息
build/f.js //线上环境的 webpack 配置信息
虚拟数据API在mock文件中,通过config.js的index.js的poxytable属性去添加
ports = {dev: {// Paths fiddler charlesassetsSubDirectory: 'static',assetsPublicPath: '/project',proxyTable: {'/api': {target: 'localhost:8082',pathRewrite: {'^/api': 'static/mock'}}},
"dependencies": {"axios": "^0.17.1","babel-polyfill": "^6.26.0","better-scroll": "^1.8.1","fastclick": "^1.0.6","stylus": "^0.54.5","stylus-loader": "^3.0.1","vue": "^2.5.2","vue-awesome-swiper": "^2.6.7","vue-router": "^3.0.1","vuex": "^3.0.1"},
$bgColor = #00bcd4
$darkTextColor = #333
$headerHeight = .86rem
resolve: {extensions: ['.js', '.vue', '.json'],alias: {'vue$': 'vue/dist/vue.esm.js','@': resolve('src'),'styles': resolve('src/assets/styles'),'common': resolve('src/common'),}},
<style lang="stylus" scoped>@import '~styles/varibles.styl'
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"
>
ellipsis()overflow: hiddenwhite-space: nowraptext-overflow: ellipsis
reset.css,初始化整体样式,去除某些标签的默认样式,比如<li></li>的小黑点;
border.css,解决移动端1px边框的问题;
import 'styles/reset.css'
import 'styles/border.css'
/* border.css */
@charset "utf-8";
.border,
.border-top,
.border-right,
.border-bottom,
.border-left,
.border-topbottom,
.border-rightleft,
.border-topleft,
.border-rightbottom,
.border-topright,
.border-bottomleft {position: relative;
}
.border::before,
.border-top::before,
.border-right::before,
.border-bottom::before,
.border-left::before,
.border-topbottom::before,
.border-topbottom::after,
.border-rightleft::before,
.border-rightleft::after,
.border-topleft::before,
.border-topleft::after,
.border-rightbottom::before,
.border-rightbottom::after,
.border-topright::before,
.border-topright::after,
.border-bottomleft::before,
.border-bottomleft::after {content: "