react兼容ie 使用最新版本的 create-react-app(v2.1.0)创建 react 项目时,在 IE 9 & IE 10 中碰到了"Map未定义"的报错: 很明显,这是 IE9 对 ES6 的兼容性问题。首先尝试了两种方式: 使用 create-react-app 官方提供的 react-app-poly...
react fetch封装 reruest.js: /** * 让fetch也可以timeout * timeout不是请求连接超时的含义,它表示请求的response时间,包括请求的连接、服务器处理及服务器响应回来的时间 * fetch的timeout即使超时发生了,本次请求也不会被abort丢弃掉,它在后台仍然会发送到服务器端...
react根元素添加元素 body添加元素 import React from 'react'; import ReactDOM from 'react-dom'; class NewPortal extends React.Component { constructor(props) { super(props) this.node = doc...
react使用antd设置menu 构建menu组件: import React from 'react' import {Link,withRouter} from 'react-router-dom' import {Menu, Icon} from 'antd' //此组件的意义就是将数据抽离出来,通过传递数据去渲染 @withRo...
react实现柱状图点击阴影 react echarts阴影点击 render(){ return ( < div > < EchartsReact option ={option} ref ={(e) => { this . echartsReactRef = e;//chu }} style ={{height : 2 + "rem" ,width : '100%...
原 React 监听屏幕尺寸变化 1.在componentDidMount()中加入监听器 componentDidMount() { this.screenChange(); } screenChange() { window.addEventListener('resize', this.resize); } resize()方法中...
react 上线相对路径 package.json: 加入 "homepage" : "." , npm run eject 之后在config里面path.js 37行 路径改为相对路径,如下 envPublicUrl || (publicUrl ? url . parse (publicUrl). pathname : '....
Node.js请求request Node.js发送请求 Node.js发送请求,需要用到request这个模块 request官网 先导入这个模块 npm install request --save GET请求 var url = 'http://192.168.0.102:3000/home?name=xmg' // 发送Get请...
express中cookie的使用和cookie-parser的解读 1. cookie的创建 express直接提供了api,只需要在需要使用的地方调用如下api即可 function (req, res, next) { ... res.cookie( name , value [, options]); ... } express就会将其填入Response Hea...
组件按需加载 import React, { Component } from 'react' export default function asyncComponent(importComponent) { class AsyncComponent extends Component { constructor(...