![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react
明月松江
年轻就是力量,有梦就有未来!
展开
-
使用ref手动改变antd的搜索框Input.Search的搜索内容
antd提供了Input.Search搜索框组件,它的其余属性和 Input 一致,通过value当然可以修改搜索内容,这里介绍另外一种方法来修改搜索的内容。直接上代码:import { useRef } from 'react';import { Input } from 'antd';...const searchRef = useRef(null)...<Input.Search ref={searchRef} placeholder='请输入' onSearch={O原创 2021-12-08 14:30:37 · 3957 阅读 · 1 评论 -
react-router下browserRouter与hashRouter的区别
先说结论:二者的最大区别就是hashRouter不支持location.key 、location.state。举例说明:homepagethis.props.history.push({ pathname:'/about', state:{ msg:'this is a msg from home' }})aboutpageconsole.log(JSON.s...原创 2020-03-23 14:43:36 · 1222 阅读 · 0 评论 -
react踩坑之redux删除数据页面无变化
最近在踩坑react,demo使用了redux,发现删除数据页面没有任何变化。代码如下:demo.js:const dispatchToProps = (dispatch)=>{ return{ deleteItem(index){ const action = deleteItemAction(index) dispatch(action) ...原创 2020-01-14 17:00:39 · 1031 阅读 · 0 评论