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