vue学习

vue学习笔记

 
对象赋值

const foo = {a: 3}

Object.assign(foo, {b: 4})

 
 
关闭sockjs.js 请求

1. 找到/node_modules/sockjs-client/dist/sockjs.js 

2.找到代码的 1605行  

  try {
  //  self.xhr.send(payload); 把这里注掉
  } catch (e) {
    self.emit('finish', 0, '');
    self._cleanup(false);
  }


@click.prevent=‘eventName’  阻止默认行为
package.json中加 —host 0.0.0.0  可用ip打开项目
解决部分机型白屏 npm install babel-polypill  —save
el-menu  设置默认选中项
 defaultActive () {
      return this.$route.path.split('/')[2]
  }
 
viewport用来设置用户在手机上的可视区域
 
width = device-width: 指定viewport宽度为设备宽度,
initial-scale = 1.0  : 指定默认缩放比例为1:1
 
通过maximum-scale和minimum-scale限定屏幕缩放比例为1:1
通过user-scalable限制用户对屏幕进行缩放
 
动态设置fontSize  
document.addEventListener(‘DOMContentLoaded’, ()=>{
  const html = document.querySelector(‘html’)
  let fontSize = window.innerWidth / 10
  fontSize = fontSize > 50 ? 50 : fontSize
  html.style.fontSize = fontSize + ‘px'
})
 
reset.scss 的目的是为了消除不同浏览器默认样式的不一致性
global.scss 规定了整个站点的公共样式、公共方法和公共参数 
flex布局换行   flex-wrap: wrap;
 
 
global.epub  es3,es5,es6
 
常量 es6
let  const
前者是后者的规则,后者是前者的实践
 
Object.freeze()   冻结一个对象
 
vue-resource  实现请求
全局拦截器
axios  get通过params传递参数
axios  post 通过data传递参数 
 
props 接收值的数据类型
props: { title: String, likes: Number, isPublished: Boolean, commentIds: Array, author: Object }
 
computed: 计算属性
 
用computed 定义prop中的值,当prop中的值修改时,computed 中的值也会动态修改,不用写watch去实时监测prop中的修改
 
 
 
vuecl3创建项目
please pick a preset 
manually select features (可选项)
 
babel
typeScript
router
vuex
linter/formatter
空格选中

unit单元测试和e2e端到端测试  

npm i vant -S -dev  安装vant移动端UI组件
 
 
open -n /Applications/Google\ Chrome.app/ --args --disable-web-security --user-data-dir=/Users/zhoupan/Downloads/user
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值