2020年5月20日

React-router params query state传值

摘要: React-router params query传值 https://blog.csdn.net/qq_39200185/article/details/100895510?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFr 阅读全文

posted @ 2020-05-20 23:06 左侧岚 阅读(753) 评论(0) 推荐(0) 编辑

React diff

摘要: React diff 阅读全文

posted @ 2020-05-20 22:58 左侧岚 阅读(107) 评论(0) 推荐(0) 编辑

使用react-router的browserHistory配置路由历史记录时刷新或者单独打开一个页面时出现NOT FOUND

摘要: https://www.cnblogs.com/wonyun/p/5889008.html 阅读全文

posted @ 2020-05-20 22:36 左侧岚 阅读(595) 评论(0) 推荐(0) 编辑

React Hooks 高阶组件(HOC) render props 以及 hook 的对比和用处 useEffect

摘要: 一、react-hooks概念 React中一切皆为组件,React中组件分为类组件和函数组件,在React中如果需要记录一个组件的状态的时候,那么这个组件必须是类组件。那么能否让函数组件拥有类组件的功能?这个时候我们就需要使用hooks。 Hooks让我们的函数组件拥有了类似类组件的特性,Hook 阅读全文

posted @ 2020-05-20 22:23 左侧岚 阅读(2984) 评论(0) 推荐(0) 编辑

React 刷新浏览器 state rudux数据都消失了

摘要: 当页面刷新之后,redux中的数据会回到初始值,之前存储到redux中的数据也就不复存在了 判断sessionStorage中是否有值,有值的话将sessionStorage中的数据直接付给defaultState,页面刷新之后,由于设置了state = defaultState,页面还是会显示存储 阅读全文

posted @ 2020-05-20 20:59 左侧岚 阅读(1571) 评论(0) 推荐(0) 编辑

React 生命周期

摘要: React 生命周期 阅读全文

posted @ 2020-05-20 20:37 左侧岚 阅读(103) 评论(0) 推荐(0) 编辑

React key

摘要: function Blog(props) { const sidebar = ( <ul> {props.posts.map((post) => <li key={post.id}> {post.title} </li> )} </ul> ); const content = props.posts 阅读全文

posted @ 2020-05-20 20:32 左侧岚 阅读(154) 评论(0) 推荐(0) 编辑

React 渲染组件

摘要: function UserGreeting(props) { return <h1>欢迎回来!</h1>; } render() { const isLoggedIn = this.state.isLoggedIn; let button = null; if (isLoggedIn) { butt 阅读全文

posted @ 2020-05-20 20:21 左侧岚 阅读(130) 评论(0) 推荐(0) 编辑

React-native 移动端

摘要: React-native 移动端 阅读全文

posted @ 2020-05-20 17:11 左侧岚 阅读(129) 评论(0) 推荐(0) 编辑

grafana 前端编译环境 引入 <iframe src="" frameborder="0" width="1280" height="860"></iframe>

摘要: yarn start yarn watch https://blog.csdn.net/weixin_41621706/article/details/100815603?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFrom 阅读全文

posted @ 2020-05-20 17:10 左侧岚 阅读(3228) 评论(0) 推荐(0) 编辑

React props refs

摘要: state 和 props 主要的区别在于 props 是不可变的,而 state 可以根据与用户交互来改变。这就是为什么有些容器组件需要定义 state 来更新和修改数据。 而子组件只能通过 props 来传递数据。 props 组件之间的通信 props用于定义外部接口,state用于记录内部状 阅读全文

posted @ 2020-05-20 17:08 左侧岚 阅读(117) 评论(0) 推荐(0) 编辑

React 登录

摘要: import {connect} from 'react-redux'; //bindActionCreators 传递action给子组件 import {bindActionCreators} from 'redux'; //用了redux 解构出里面的loginSuccessCreator方法 阅读全文

posted @ 2020-05-20 15:17 左侧岚 阅读(279) 评论(0) 推荐(0) 编辑

module.exports/exports和module.export/export default {}

摘要: module.exports/exports和module.export/export default {} 阅读全文

posted @ 2020-05-20 14:21 左侧岚 阅读(116) 评论(0) 推荐(0) 编辑

react-router 点击左侧栏 路由传参 路由跳转携带参数 两个左侧栏进入同一个组件 可以知道点击的哪个左侧栏进入的组件 react-router-dom多路由共用一个组件时 切换页面地址 页面不刷新的问题

摘要: import {Provider} from 'react-redux' import {Router, hashHistory, Route, IndexRoute, Switch} from 'react-router'; import store from 'redux/store.js'; 阅读全文

posted @ 2020-05-20 11:33 左侧岚 阅读(494) 评论(0) 推荐(0) 编辑

封装ajax

摘要: import Logger from "./Logger"; //日志 import superagent from "superagent"; //superagent import globalConfig from "../config"; //config.js const logger = 阅读全文

posted @ 2020-05-20 10:22 左侧岚 阅读(172) 评论(0) 推荐(0) 编辑

React `${}` 格式

摘要: //config.js module.exports = { getAPIPath() {} } import globalConfig from "../config"; `${globalConfig.getAPIPath()} `` 创建一个字符串 不需要使用字符串连接 // Current 阅读全文

posted @ 2020-05-20 10:19 左侧岚 阅读(2239) 评论(0) 推荐(0) 编辑

echarts-for-react

摘要: import React from "react"; import ReactEcharts from "echarts-for-react"; class TaskChart extends React.PureComponent { getOption() { var symbolSize = 阅读全文

posted @ 2020-05-20 10:04 左侧岚 阅读(2019) 评论(0) 推荐(0) 编辑

React 列表 瀑布流 修改样式瀑布流不起效果

摘要: React 列表 瀑布流 阅读全文

posted @ 2020-05-20 09:48 左侧岚 阅读(433) 评论(0) 推荐(0) 编辑

导航