Days14 vue项目实战2

2018-08-15  本文已影响0人  biu丶biubiu

1.git的使用

git clone url   git add .   git commit  -m   'description'  git push

创建分支后,git pull ,git checkout  branch  切换到分支进行操作

git status查看当前分支和其他修改等信息

在分支写完一个功能后  git checkout  master    git  merge  origin/new-branch  git push  将修改合并到主分支

2.vue-init项目初始化

1.完善index.html中的meta标签 添加   ,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no

2.在main.js中 引入reset.css 和 border.css 解决浏览器兼容以及移动端1px边框问题

3.npm install fastclick --save 在main.js中 import fastClick from 'fastclick'      fastClick.attach(document.body) 解决移动端点击事件有300ms延迟的问题

3.Stylus

npm install stylus --save      npm install  stylus-loader --save    

使用<style lang="stylus">     </style>

创建variable.styl 定义常用样式  $background-corlor=#eee     calss:$background

创建mixins.styl 封装通用样式   function()font-size:18px;       class:function()

4.rem

移动端布局,rem=  设置的px   /   默认的px    

一般reset.js中font-size:50px,   height:.5rem   25/50=0.5   height:25px

给盒子设置固定高宽比 :overflow: hidden  width: 100%  height: 0 padding-bottom: h/w%

5.自定义路径名

有时候路径名繁杂,使用不方便,可以在build目录下的webpack.base.config.js  resolve中设置 

webpack.base.config.js  resolve

6.vue-awesome-swiper

Github vue-awesome-swiper使用

7.样式穿透

使用组件时,想在父组件修改子组件的样式,可以通过>>>来查找类名,进行修改

.content >>> .swiper

8.vue.js devtools

谷歌浏览器的vue调试扩展工具

9.组件:创建  >  引入  >  声明(全局/局部)  >  使用

10.   .gitignore

项目根目录下,设置要git命令不需要提交的内容

11.proxyTable

项目目录中只有static可以被外部直接访问,通过在static下设置mock和config/index.js中proxyTable来实现本地发送ajax请求进行数据测试

proxyTable

12.Better-scroll

GIthub better-scroll使用

上一篇 下一篇

猜你喜欢

热点阅读