摘要: <Form.Item getValueFromEvent={onEvent} > <Input maxLength={20} allowClear onCompositionEnd={(e)=>{onEnd(e,'clientName',true)}} onCompositionStart={onS 阅读全文
posted @ 2023-08-22 14:33 marvinLiu 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 当升级到react18后,如出现接口连续调用两次或项目中form.setFieldsValue失效的问题,那么就检查入口文件是否存在 <React.StrictMode>,若存在就去掉,问题就解决了。 阅读全文
posted @ 2023-03-27 10:35 marvinLiu 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 需求:限制input框只能输入中文 英文 数字 正则: event.target.value.replace(/[^a-zA-Z0-9\u4E00-\u9FA5]/g,'') 使用这个正则后,大部分场景没问题,但是如果先输入英文或数字,再输入汉字时,会将之前的字符清空掉几个,具体几个根据输入汉字个数 阅读全文
posted @ 2022-05-09 14:48 marvinLiu 阅读(470) 评论(1) 推荐(0) 编辑
摘要: https://blog.csdn.net/halo1416/article/details/119648840 阅读全文
posted @ 2022-05-09 11:11 marvinLiu 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 原理:使用object.assign(target,source)方法。将source对象属性复制到target。 即:object.assign( this.$data , this.$options.data(this) ) 说明:this.$data即是vue组件中的data this.$op 阅读全文
posted @ 2021-12-08 11:21 marvinLiu 阅读(817) 评论(0) 推荐(0) 编辑
摘要: 1. 只能输入数字 <Item label="code"> {getFieldDecorator("code", { initialValue: code, rules: [ { required: true, message: "请输入code" }, { required: false, pat 阅读全文
posted @ 2021-08-16 11:20 marvinLiu 阅读(907) 评论(0) 推荐(0) 编辑
摘要: window.performance.getEntries(); 此方法返回网站所有静态资源(脚本、图片、样式等)的http请求时间数组 。 示例: var result = []; window.performance.getEntries().forEach(function (item) { 阅读全文
posted @ 2021-05-11 10:01 marvinLiu 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 一对夫妻和一头驴。 丈夫牵着驴,妻子骑着驴。 路人指指点点,这女人太不像话了,居然让男人给他牵驴。 妻子听了不好意思,于是和丈夫换了位置。 结果没走几步,又有人说:你看,这男的真不像话,让自己老婆牵驴,大男子主义。 这下丈夫又脸红了,他们决定夫妻一起骑驴。 两人骑着驴,又没走几步路, 路人指指点点的 阅读全文
posted @ 2020-11-26 15:04 marvinLiu 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 1. 监听数据变化的实现原理不同 Vue 通过 getter/setter 以及一些函数的劫持,能精确知道数据变化,不需要特别的优化就能达到很好的性能 React 默认是通过比较引用的方式进行的,如果不优化(PureComponent/shouldComponentUpdate)可能导致大量不必要的 阅读全文
posted @ 2020-11-02 11:43 marvinLiu 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 什么是KeepAlive? 首先,我们要明确我们谈的是TCP的 KeepAlive 还是HTTP的 Keep-Alive。TCP的KeepAlive和HTTP的Keep-Alive是完全不同的概念,不能混为一谈。 TCP的keepalive是侧重在保持客户端和服务端的连接,一方会不定期发送心跳包给另 阅读全文
posted @ 2020-10-19 16:42 marvinLiu 阅读(108) 评论(0) 推荐(0) 编辑