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';
createStore 创建一个store
store.dispatch() 帮助我们派发一个action
store.getState() 帮助我们获取到state里面所有的数据内容
store.subscribe 可以订阅 store数据的改变 ,只要数据发生改变,store.subscribe接受的回调函数就会被执行