• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






xintong1314

学无止境
 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
1 2 下一页

2017年5月12日

js中的截流
摘要: componentDidMount(){ let timeoutId function callback(){ } window.addEventListener('scroll',function(){ if(this.props.isLoadingMore){ return } if(timeo 阅读全文
posted @ 2017-05-12 09:04 xintong1314 阅读(688) 评论(0) 推荐(0)
 

2017年5月11日

react代码分离方案
摘要: 智能组件containers :私有的 在日常开发中,我们也简称“页面”。为何说它“智能”,因为它只会做一些很聪明的事儿,脏活累活都不干。它只对数据负责,只需要获取了数据、定义好数据操作的相关函数,然后将这些数据、函数直接传递给具体实现的组件即可。 木偶组件components:公共的 这里“木偶” 阅读全文
posted @ 2017-05-11 11:13 xintong1314 阅读(802) 评论(0) 推荐(0)
 

2017年5月5日

redux在react中的使用
摘要: 简单的redux示例: // 第一步 定义计算规则,即 reducer function counter(state = 0, action) { switch (action.type) { case 'INCREMENT': return state + 1 case 'DECREMENT': 阅读全文
posted @ 2017-05-05 10:27 xintong1314 阅读(169) 评论(0) 推荐(0)
 

2017年3月17日

react 生命周期
摘要: import React from 'react';import ReactDOM from 'react-dom'; //子类 class SayHello2 extends React.Component{ constructor(props){ super(props); this.state 阅读全文
posted @ 2017-03-17 14:20 xintong1314 阅读(144) 评论(0) 推荐(0)
 
react 函数bind(this)的三种方式
摘要: 1.在调用地方直接bind(this) handleClick(){ this.setState({ word2:'word2 changed' }) } <button onClick={this.handleClick.bind(this)}>点击</button> 2、使用ES6 箭头函数 h 阅读全文
posted @ 2017-03-17 13:29 xintong1314 阅读(367) 评论(0) 推荐(0)
 
react 三种组件定义方式
摘要: import React from 'react';import ReactDOM from 'react-dom';/1、/function sayHellofunction SayHello(props){ return <h1>hello {props.name}</h1>}ReactDOM. 阅读全文
posted @ 2017-03-17 13:00 xintong1314 阅读(190) 评论(0) 推荐(0)
 

2017年3月13日

linux系统下nginx安装目录和nginx.conf配置文件目录
摘要: linux系统下nginx安装目录和nginx.conf配置文件目录 1、查看nginx安装目录 输入命令 # ps -ef | grep nginx 返回结果包含安装目录 root 2662 1 0 07:12 ? 00:00:00 nginx: master process /usr/sbin/ 阅读全文
posted @ 2017-03-13 21:08 xintong1314 阅读(62720) 评论(0) 推荐(2)
 

2017年3月9日

react component lifecycle
摘要: hook函数Mounting:componentWillMount:在Component 将要Mounting前被调用 componentDidMount:在Component mounted之后被调用 getInitialState :初始化component stateupdateing:com 阅读全文
posted @ 2017-03-09 22:51 xintong1314 阅读(277) 评论(0) 推荐(0)
 
ES6学习: 需要加深理解的地方
摘要: 变量的解构赋值 对象的解构赋值 let arr = [1, 2, 3]; let {0 : first, [arr.length - 1] : last} = arr; first // 1 last // 3 段落的解构赋值 字符串也可以解构赋值。这是因为此时,字符串被转换成了一个类似数组的对象。 阅读全文
posted @ 2017-03-09 16:32 xintong1314 阅读(183) 评论(0) 推荐(0)
 

2017年3月6日

转:浏览器的重绘、回流及网页优化
摘要: 定义 重绘是指当color\background-color等与视觉相关的样式属性值被更新时触发绘制过程,在绘制过程中要重新计算元素的视觉信息,使元素呈现新的外观。回流是指当窗口尺寸被修改(resize),发生滚动操作,或者position\display\width\height等元素位置相关属性 阅读全文
posted @ 2017-03-06 15:54 xintong1314 阅读(114) 评论(0) 推荐(0)
 
1 2 下一页