![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
React+Antd
enjoy嚣士
一个行走在键盘上的修理工
展开
-
react之禁止<a>标签响应
禁用a标签原创 2022-06-08 14:20:40 · 1374 阅读 · 0 评论 -
前端串口通信
以下是前端关于串口通信的一些参考文章文章1文章2文章3文章4文章5个人觉得文章1就基本够了原创 2022-04-25 09:25:44 · 400 阅读 · 0 评论 -
react 之 页面跳转方法及问题
html页面跳转转载 2022-03-28 16:18:41 · 1847 阅读 · 0 评论 -
ES6中Json、String、Map、Object之间的转
import React, {Component} from 'react'/** *JsonUitl的实现 */export default class JsonUtils extends React.Component { /** *字符串转json * */ static stringToJson(data){ return JSON.parse(data); } /** *json转字符串 *转载 2022-03-28 16:09:09 · 526 阅读 · 0 评论 -
react 之 antd的input控件动态更新内容
注意:Form里 initialValues 不能被 setState 动态更新,你需要用 setFieldsValue 来更新。代码:myForm = React.createRef()//就是上面图片ref的容器onChange = (e) => { this.setState({ modelCurrentValue: name, },() => { //categoryName是输入框name的属性值,后面则原创 2022-03-28 15:56:17 · 1794 阅读 · 0 评论 -
React 之 Error: Maximum update depth exceeded
错误:Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.在编写控件时,我们需要在数据变化时对state里面的变量进行赋值,通原创 2022-03-19 12:41:15 · 2192 阅读 · 0 评论 -
js下载url文件
需求后台返回文件的URL,前端自动下载实现 function download(url, filename){ const elelink = document.createElement("a"); elelink.style.display = 'none'; elelink.download = filename; elelink.href = url; document.body.appendChild(elelink); eleli原创 2021-05-26 09:33:30 · 3981 阅读 · 0 评论 -
React中在javascript函数中使用state存储的变量
步骤1.导入store模块2.获取state3.获取state中的变量import store from "@/store";const state = store.getState();console.log(state.myVar);原创 2020-06-22 19:52:06 · 1269 阅读 · 0 评论 -
React中在javascript函数中调用dispatch函数
环境React(16.13.0)+antd(4.3.4)+redux(7.2.0)步骤导出store模块,之后在外部调用时导入模块即可使用相关函数。// store.jsimport { createStore } from 'redux'export default createStore(reducers)// somefile.jsimport store from './store'store.dispatch(someAction)以上来自网络但是我在实际使用中,使原创 2020-06-22 19:51:01 · 4083 阅读 · 0 评论 -
antd 之 Warning: children of Tree is deprecated. Please use treeData instead
antd 4.0版本以前,使用tree控件方法和4.0之后不相同。因此,如果3.0升级到4.0遇到标题这样的问题。只需要将Tree属性设置数据即可。3.0 写法<Tree onSelect={this.onSelect} onExpand={this.onExpand} expandedKeys={expandedKeys} autoExpandParent={autoExpandParent}> { resData.length>0 ? lo原创 2020-06-10 09:54:46 · 9487 阅读 · 7 评论 -
antd 之 Each child in a list should have a unique key prop
解决问题:一般出现这个问题由于内循环生成多个组件,没有给组件加上key引起的,因为dom进行diff对比 没有key值,所以报错警告。 此时我们需要循环生成多个组件中,加上key值(唯一值)那么就不会报错了。比如:const Option=Select.Option;<Select style={{width: 200}} allowClear onChange={(value)=>{onCustomerChange(value, this)}}> { .原创 2020-06-10 09:49:03 · 8082 阅读 · 0 评论