摘要: cookie cookie在浏览器和服务器间来回传递,主要应用场景: 保持登录 保持上次查看的页面 浏览计数 广告追踪 购物车的状态保持 Cookies是如何起效的? 当浏览器从web的回应到页面请求中接收到一个 Set-Cookie 头部时Cookies便创建了: 1 2 3 1 2 3 浏览器接 阅读全文
posted @ 2017-06-28 23:13 <张磊> 阅读(148) 评论(0) 推荐(0)
摘要: webpack工具相信用react的同学都比较熟悉了,一个很爽的功能——热更新,稍微改个分号都能够在浏览器局部刷新,很厉害有木有。 安静一下,同学们,不要喧哗! 本章内容不讲热更新,我们来看看webpack的另外一个功能——代码切割(或者叫做路由切割)。 作为react开发者,你应该用过react- 阅读全文
posted @ 2017-06-28 22:08 <张磊> 阅读(498) 评论(0) 推荐(0)
摘要: 用来把文件读入内存,并且读取文件中的数据。FileReader接口提供了一个异步API,使用该API可以在浏览器主线程中异步访问文件系统,读取文件中的数据。到目前文职,只有FF3.6+和Chrome6.0+实现了FileReader接口。 1、FileReader接口的方法 FileReader接口 阅读全文
posted @ 2017-06-20 21:53 <张磊> 阅读(186) 评论(0) 推荐(0)
摘要: form 模式 ant this.props.form.setFieldsValue({eee:''}) 阅读全文
posted @ 2017-05-22 10:16 <张磊> 阅读(452) 评论(0) 推荐(0)
摘要: componentDidMount(){ this.props.router.setRouteLeaveHook(this.props.route, () => { //if (this.state.unsaved) return 'You have unsaved information, are 阅读全文
posted @ 2017-05-22 10:15 <张磊> 阅读(4957) 评论(0) 推荐(0)
摘要: connect([mapStateToProps], [mapDispatchToProps], [mergeProps],[options]) 连接 React 组件与 Redux store。 连接操作不会改变原来的组件类,反而返回一个新的已与 Redux store 连接的组件类。 参数 [mapStateToProps(state, [ownProps]): stateProp... 阅读全文
posted @ 2017-05-18 12:46 <张磊> 阅读(2764) 评论(0) 推荐(0)
摘要: React-free-scrollbar npm version A react module for creating customizable scroll area Visit http://fuermosi777.github.io/react-free-scrollbar/ to see demo. Install $ npm install --save react-fre... 阅读全文
posted @ 2017-04-21 23:44 <张磊> 阅读(6180) 评论(0) 推荐(0)
摘要: 1.声明action常量 export const INCREASE = 'INCREASE' export const GETSUCCESS = 'GETSUCCESS' 2.初始化state数据 const initialState = { number: 1, lists: [ { text: 'ww整个应用的 sta... 阅读全文
posted @ 2017-04-18 23:57 <张磊> 阅读(156) 评论(0) 推荐(0)
摘要: [].forEach(function(value, index, array) { // ... }); 对比jQuery中的$.each方法: $.each([], function(index, value, array) { // ... }); 会发现,第1个和第2个参数正好是相反的,大家 阅读全文
posted @ 2017-03-25 06:28 <张磊> 阅读(142) 评论(0) 推荐(0)
摘要: 1. let, const 这两个的用途与var类似,都是用来声明变量的,但在实际运用中他俩都有各自的特殊用途。 首先来看下面这个例子: var name = 'zach' while (true) { var name = 'obama' console.log(name) //obama break } console.log(name) //obama 使... 阅读全文
posted @ 2017-03-15 13:14 <张磊> 阅读(1198) 评论(0) 推荐(0)