日日行,不怕千万里
摘要: 基本js下载思路: 创建a标签, 给a标签创建download属性, 在属性中点击下载。 一般后台会返回file_pathurl进行赋值 实现过程: function downLoadeFile(file_path) { const a = document.createElement('a'); 阅读全文
posted @ 2018-02-07 23:47 GongXiaoZhu 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Redux 类似于一个state 数据树,将所有的 数据存储到这个 store 上. reducer / action 其中 reducer 存储的数据,action 是出发的动作,唯一一个修改 reducer 的,其中内部的 subscrible 是一个监听。 // react -redux 使用 阅读全文
posted @ 2017-12-03 22:43 GongXiaoZhu 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 1、Hello React 简单组件搭建。 var HelloReact = React.createClass({ render: function() { return ( <div>Hello React!</div> ) } }); ReactDOM.render( <HelloReact 阅读全文
posted @ 2017-11-05 16:21 GongXiaoZhu 阅读(617) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-11-05 13:39 GongXiaoZhu 阅读(454) 评论(0) 推荐(0) 编辑
摘要: 1、基本鼠标事件: mouseenter:当鼠标移入某元素时触发。 mouseleave:当鼠标移出某元素时触发。 mouseover:当鼠标移入某元素时触发,移入和移出其子元素时也会触发。 mouseout:当鼠标移出某元素时触发,移入和移出其子元素时也会触发。 mousemove:鼠标在某元素上 阅读全文
posted @ 2017-11-04 21:40 GongXiaoZhu 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 1、存储数据20M 2、window.localStorage对象下属性 3、数据只能存储字符串 4、localStorage必须手动删除 localStorage 的使用方法: const a = window.localStorage; 存储数据:a.setItem('数据的名字', '数据') 阅读全文
posted @ 2017-11-03 18:22 GongXiaoZhu 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 拷贝:顾名思义就是复制。 1、浅拷贝:把父对象的属性,全部拷贝到子对象 function extendCopy(p) { var c = { }; for (var i in p) { c[i] = p[i] }; return c; } 2、 深拷贝就是能实现真正意义上的数组和对象的拷贝。 fun 阅读全文
posted @ 2017-11-03 11:47 GongXiaoZhu 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Array.prototype.outputMaxPrice = function outputMaxPrice (array) { const item1 = Math.max.apply( Math, array ); const item2 = Math.min.apply( Math, ar 阅读全文
posted @ 2017-10-30 23:29 GongXiaoZhu 阅读(1234) 评论(0) 推荐(0) 编辑
摘要: <div id='box' style="width: 400px; height: 400px"> <div id='center'> 未知宽高的div </div> </div> const box = document.querySelector("#box"); const center = 阅读全文
posted @ 2017-10-30 19:28 GongXiaoZhu 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 1、基本项目中gitlab操作: 阅读全文
posted @ 2017-10-29 21:19 GongXiaoZhu 阅读(1042) 评论(0) 推荐(0) 编辑