07 2020 档案
react-router-dom 的基本使用
摘要:1 安装:cnpm i react-router-dom 2 3 4 5 <Route path='/' exact render={()=><div>home</div>}></Route> 6 7 当路径为/根路径时候显示里面的内容home,exact 表示完全配置这个路径, 8 9 例如为ht
immutable库和redux-immutable库使用
摘要:文档目录 immutable使用 1、安装:cnpm i immutable 在reducer中引用 import { fromJS } from 'immutable'; const defaultState = fromJS ({ focused : false }); immutable对象s
styled-components用法
摘要:styled-components用法 定义样式 import styled from 'styled-components'; export const HeaderWrapper = styled.div` height:56px; background:red; ` 组件里面使用 import
react 简书项目1
摘要:1、项目初始化配置 styled-components让css项目互相不干扰 cnpm i styled-components 使用方法 import { createGlobalStyle } from 'styled-components'; export const Globalstyle =
react-redux1
摘要:安装react-redux cnpm i react-redux 文件目录 定义store文件 1 index.js文件: 2 3 import { createStore } from 'redux'; 4 import reducer from './reducer'; 5 const stor
使用“ create-react-app my-app”命令 ,package.json中缺少依赖项
摘要:我试了很多办法,重装node升级npm,都失败了,git上发现 create-react-app myproject --use-npm能够暂时解决,但是我安装ant desig时候package.json中缺少依赖项提示有出来了,而且安装失败,后面我卸载了C:\Users\Administrato
Redux与Ant Design
摘要:redux安装 npm add redux Ant Design 安装 npm add antd 引入css import 'antd/dist/antd.css'; 组件使用 import { Input, Button,List, Typography, Divider } from 'antd
使用react-transition-group实现动画
摘要:安裝:cnpm i react-transition-group 详细介绍: https://reactcommunity.org/react-transition-group/css-transition /* 显示 */ /* fade-appear第一次显示执行的样式 */ .fade-ent