2019年1月25日
摘要: function add(){};add.prototype.showName = "MAN";add.prototype.name = function(){ console.log(this.showName);}new add().name(); var cat = {};Object.get 阅读全文
posted @ 2019-01-25 14:21 hdq用心微笑 阅读(154) 评论(0) 推荐(0)
摘要: var arr = [1,2,3,34]; arr.each = function(array,fn){ for(let i=0;i<array.length;i++){ fn(array[i]) } } arr.each(arr,function(v){ console.log(v) }) 阅读全文
posted @ 2019-01-25 14:19 hdq用心微笑 阅读(135) 评论(0) 推荐(0)
摘要: document.querySelectorAll('#id').style.color = 'red';document.querySelectorAll('#id').style.fontSize = '12px';document.querySelectorAll('#id').style.b 阅读全文
posted @ 2019-01-25 14:17 hdq用心微笑 阅读(167) 评论(0) 推荐(0)
摘要: --save 是发布会还在使用 --save-dev 是在开发中需要用到的 --save 依赖的文件在denpendencis下 --save-dev 依赖的文件都在dvedependencis下 阅读全文
posted @ 2019-01-25 14:01 hdq用心微笑 阅读(187) 评论(0) 推荐(0)
摘要: wanterFun = (times)=>{ //时间:百分比 let warterMap = { 6:8, 8:22, 10:34, 12:57, 14:66, 16:85, 18:90, 20:95, 22:100, } if(times<6){ return 0; }else{ return 阅读全文
posted @ 2019-01-25 13:48 hdq用心微笑 阅读(223) 评论(0) 推荐(0)
摘要: componentDidMount :生命周期在react下只调用一次, render:比它先执行 componentWillRecvieProps(newProps) :能取到父组件的值 render(){ return } 下需要返回,不然报错 父组件传值 父组件:index render(){ 阅读全文
posted @ 2019-01-25 13:45 hdq用心微笑 阅读(88) 评论(0) 推荐(0)
摘要: react 表单this.handleChange(key,e){ [key]:e.target.value}submit=()=>{ const {userName,age,status}=this.state; let parmas = { userName, age, status } }re 阅读全文
posted @ 2019-01-25 13:43 hdq用心微笑 阅读(1381) 评论(0) 推荐(0)