11 2018 档案

摘要:超级字符串内class正则匹配替换 ... 阅读全文
posted @ 2018-11-29 14:14 徐同保 阅读(238) 评论(0) 推荐(0) 编辑
摘要:注释掉 this.setState({val: this.state.val + 6}) 时:不注释掉 this.setState({val: this.state.val + 6}) 时: import React, { Component } from ... 阅读全文
posted @ 2018-11-22 12:04 徐同保 阅读(151) 评论(0) 推荐(0) 编辑
摘要:setState 通过引发一次组件的更新过程来引发重新绘制setState 方法被调用时,会引起 React 的 4 个生命周期的函数被调用: shouldComponentUpdate (this.state 没有得到更新) componentWillU... 阅读全文
posted @ 2018-11-22 11:36 徐同保 阅读(118) 评论(0) 推荐(0) 编辑
摘要:mountComponent 本质上是通过 递归渲染 内容的,由于递归的特性,父组件的 componentWillMount 一定在其子组件的 componentWillMount 之前调用,而父组件的 componentDidMount 肯定在其子组件的 comp... 阅读全文
posted @ 2018-11-21 19:01 徐同保 阅读(209) 评论(0) 推荐(0) 编辑
摘要:从头实现一个简易版的React虚拟dom和diff算法 阅读全文
posted @ 2018-11-21 16:45 徐同保 阅读(221) 评论(0) 推荐(0) 编辑
摘要:React在Virtual DOM上实现了DOM diff算法,当数据更新时,会通过diff算法计算出相应的更新策略,尽量只对变化的部分进行实际的浏览器的DOM更新,而不是直接重新渲染整个DOM树,从而达到提高性能的目的。你给我一个数据,我根据这个数据生成一个全新的V... 阅读全文
posted @ 2018-11-20 19:05 徐同保 阅读(441) 评论(0) 推荐(0) 编辑
摘要:App.jsimport React, { Component } from 'react';import CSSModules from 'react-css-modules';import styles from './App.module.css';class ... 阅读全文
posted @ 2018-11-15 11:57 徐同保 阅读(153) 评论(0) 推荐(0) 编辑
摘要:import React, { Component } from 'react';import { BrowserRouter as Router, Route, Link } from "react-router-dom";const Index = () => ... 阅读全文
posted @ 2018-11-13 19:01 徐同保 阅读(110) 评论(0) 推荐(0) 编辑
摘要:g2 slider g2-plugin-slider.js /* eslint-disable *///修改的地方注明了 mytest(functio... 阅读全文
posted @ 2018-11-09 09:50 徐同保 阅读(1002) 评论(0) 推荐(0) 编辑
摘要:React 在body上绑定事件以及阻止事件冒泡 阅读全文
posted @ 2018-11-07 19:01 徐同保 阅读(1635) 评论(0) 推荐(0) 编辑
摘要:使用classnames: 一个简单的JavaScript实用程序,用于有条件地将类名连接在一起。 <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>React 动态填加class</title> <script src="h 阅读全文
posted @ 2018-11-07 14:43 徐同保 阅读(4) 评论(0) 推荐(0) 编辑
摘要:React 动态填加class 阅读全文
posted @ 2018-11-07 14:44 徐同保 阅读(3074) 评论(0) 推荐(0) 编辑
摘要:React 点击按钮显示div与隐藏div 阅读全文
posted @ 2018-11-07 13:58 徐同保 阅读(9294) 评论(1) 推荐(1) 编辑
摘要:g2曲线图 每条曲线有单独的选中效果和tooltip 阅读全文
posted @ 2018-11-05 17:39 徐同保 阅读(618) 评论(0) 推荐(0) 编辑
摘要:下载链接:https://pan.baidu.com/s/1nB2JJp9hhqRKA7l95idoTAvpn插件:https://pan.baidu.com/s/1UZEoPkAdCeYYpIK2HfVgfA 阅读全文
posted @ 2018-11-05 10:04 徐同保 阅读(346) 评论(0) 推荐(0) 编辑
摘要:拥有overflow:hidden样式的块元素不具有position:relative和position:absolute样式; 内部溢出的元素是通过position:absolute绝对定位,并且该定位元素的包含块是设置overflow:hidden元素的父级元素 ... 阅读全文
posted @ 2018-11-02 10:51 徐同保 阅读(346) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示