摘要:
我们在项目过程中,有时候会遇到需要将两个数组合并成为一个的情况。比如: var a = [1,2,3]; var b = [4,5,6]; 有两个数组a、b,需求是将两个数组合并成一个。方法如下: 1、contact js的Array对象提供了一个叫concat()方法,连接两个或更多的数组,并返回 阅读全文
摘要:
(一)page1 引入ant message 组件2 定义state中接收数据state = { stateData:[], };3 请求数据componentDidMount() { this.queryStateSelectList()}queryStateSelectList = ()=>{ 阅读全文
摘要:
/** * 防止同一个生成的页面 生成的两个页面之间切换不刷新 * @param nextProps */ componentWillReceiveProps(nextProps) { const { dispatch } = this.props; if (this.props.match.params.pageUK != nextProps.match.... 阅读全文
摘要:
1 link方式 使用v2,v3this.props.location.query或者v4的this.props.location.search接收值 2 routerRedux方式 使用this.props.location.params接收值 阅读全文
摘要:
例如:不建议这样使用,特别是字体库比较大的时候: @font-face { font-family: f; src: url('//storage.jd.com/sy-static.jd.com/1545378205864_Arial.ttf'); } 阅读全文
摘要:
function isJsonString(str) { try { if (typeof JSON.parse(str) == "object") { return true; } } catch(e) { } return false; } ... 阅读全文
摘要:
2018年最值得关注学习的25个JavaScript开源项目 为大家推荐GitHub上25个今年最值得关注学习的JavaScript开源项目,这些项目的平均star数达到5000个。 No.1 Prettier:一款帮你解决代码风格问题的代码格式化工具,功能强大,简单易用,支持多语言,减少配置项。[ 阅读全文