摘要: 我们在项目过程中,有时候会遇到需要将两个数组合并成为一个的情况。比如: var a = [1,2,3]; var b = [4,5,6]; 有两个数组a、b,需求是将两个数组合并成一个。方法如下: 1、contact js的Array对象提供了一个叫concat()方法,连接两个或更多的数组,并返回 阅读全文
posted @ 2021-01-05 14:39 米虫的小圈子 阅读(1869) 评论(0) 推荐(0) 编辑
摘要: (一)page1 引入ant message 组件2 定义state中接收数据state = { stateData:[], };3 请求数据componentDidMount() { this.queryStateSelectList()}queryStateSelectList = ()=>{ 阅读全文
posted @ 2020-01-13 15:32 米虫的小圈子 阅读(349) 评论(0) 推荐(0) 编辑
摘要: /** * 防止同一个生成的页面 生成的两个页面之间切换不刷新 * @param nextProps */ componentWillReceiveProps(nextProps) { const { dispatch } = this.props; if (this.props.match.params.pageUK != nextProps.match.... 阅读全文
posted @ 2019-06-11 14:05 米虫的小圈子 阅读(721) 评论(0) 推荐(0) 编辑
摘要: 1 react性能待优化点 阅读全文
posted @ 2019-05-22 14:37 米虫的小圈子 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 1 link方式 使用v2,v3this.props.location.query或者v4的this.props.location.search接收值 2 routerRedux方式 使用this.props.location.params接收值 阅读全文
posted @ 2018-12-24 11:16 米虫的小圈子 阅读(480) 评论(0) 推荐(0) 编辑
摘要: 例如:不建议这样使用,特别是字体库比较大的时候: @font-face { font-family: f; src: url('//storage.jd.com/sy-static.jd.com/1545378205864_Arial.ttf'); } 阅读全文
posted @ 2018-12-21 16:15 米虫的小圈子 阅读(181) 评论(0) 推荐(0) 编辑
摘要: function isJsonString(str) { try { if (typeof JSON.parse(str) == "object") { return true; } } catch(e) { } return false; } ... 阅读全文
posted @ 2018-10-10 15:14 米虫的小圈子 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 2018年最值得关注学习的25个JavaScript开源项目 为大家推荐GitHub上25个今年最值得关注学习的JavaScript开源项目,这些项目的平均star数达到5000个。 No.1 Prettier:一款帮你解决代码风格问题的代码格式化工具,功能强大,简单易用,支持多语言,减少配置项。[ 阅读全文
posted @ 2018-09-20 11:11 米虫的小圈子 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 问题描述 js处理长整形 精度问题有什么好的解决方式吗alert(10214734953631045); alert(10214734953631046);输出分别是1021473495363104410214734953631046后端数据中有大量的数据都是涉及到长整形的数据服务端的数据本来就保存 阅读全文
posted @ 2018-08-29 14:15 米虫的小圈子 阅读(500) 评论(0) 推荐(0) 编辑
摘要: function isIphoneX(){ return /iphone/gi.test(navigator.userAgent) && (screen.height == 812 && screen.width == 375) } 阅读全文
posted @ 2018-08-29 09:40 米虫的小圈子 阅读(2798) 评论(0) 推荐(0) 编辑