
react
文章平均质量分 53
前端小李
这个作者很懒,什么都没留下…
展开
-
react移动端适配之vw适配 postcss-px-to-viewport插件
react 适配移动端原创 2022-10-15 19:15:51 · 1689 阅读 · 2 评论 -
react中withRouter解决props返回为空
使用withRouterimport { Route, Link, withRouter } from 'react-router-dom'export default withRouter(MovieApp)原创 2020-03-27 11:24:58 · 519 阅读 · 0 评论 -
react axios的跨域请求
react axios的跨域请求1.安装npm install axios2.在package.json下添加“proxy”: {“/app”: {“target”: “http://open.douyucdn.cn”,“changeOrigin”: true}}3新增一个http.js文件import axios from ‘axios’;axios.defaults.ba...原创 2020-03-16 10:38:52 · 2032 阅读 · 0 评论 -
react 打包出现空白页面报错
import { HashRouter as Router, Route } from 'react-router-dom'import createHistory from 'history/createHashHistory'const history = createHistory()<Router history={history}> <...原创 2020-01-02 10:24:04 · 820 阅读 · 0 评论 -
react 跨域请求
1、安装http-proxy-middlewarenpm install http-proxy-middleware2、在src目录下创建setupProxy.js,加入以下代码const proxy = require('http-proxy-middleware')module.exports = function (app) { app.use(proxy('/api', {...原创 2019-05-23 17:33:36 · 604 阅读 · 0 评论 -
react 创建组件的两种方式的 区别
1. 使用function构造函数创建的组件内部没有state私有数据,只有一个props来 接收外界传递过来的数据;2.使用class关键字创建的组件,内部除了有this.props这个只读属性外还有一个专门用于存放自己私有数据的this.state属性,这个state是可读可写的.3. 使用function创建的组件叫做无状态组件,使用class创建的组件叫做有状态组件4.有状态和无状态...原创 2019-07-22 17:10:26 · 269 阅读 · 0 评论