随笔分类 -  react

ant design 轮播图左右两边加箭头
摘要:<Carousel autoplay arrows={true} prevArrow={<LeftOutlined />} nextArrow={<RightOutlined />}> </Carousel> .ant-carousel .slick-prev, .ant-carousel .sli 阅读全文
posted @ 2023-03-23 11:04 chenlw101 阅读(345) 评论(0) 推荐(0)
模拟登录 react 的页面
摘要:let input = document.getElementById('username'); let lastValue = input.value; input.value = '6d915519acf411e9b502fa528da74700'; let event = new Event( 阅读全文
posted @ 2021-11-16 14:49 chenlw101 阅读(243) 评论(0) 推荐(0)
Create React App 代理与axios设置
摘要://package.json(跨域设置) "proxy": "http://10.0.0.36", //打包路径出错修改 package.json中 "homepage": "./", //axios设置 import axios from 'axios' import qs from 'qs' i 阅读全文
posted @ 2021-01-16 13:42 chenlw101 阅读(456) 评论(0) 推荐(0)
react带ts创建
摘要:npx create-react-app my-app --template typescript 阅读全文
posted @ 2020-12-11 11:17 chenlw101 阅读(460) 评论(0) 推荐(0)
taro3.0包体积过大问题
摘要:npm i --save-dev terser-webpack-plugin /config/index.js import TerserPlugin from "terser-webpack-plugin" const config = { mini: { webpackChain(chain, 阅读全文
posted @ 2020-07-13 17:26 chenlw101 阅读(3506) 评论(0) 推荐(0)
taro引入taro-ui出现引入index.scss错误问题
摘要:package.json "devDependencies": { "taro-ui": "^3.0.0-alpha" } app.scss @import '~taro-ui/dist/style/index.scss'; 任意使用ui界面 import { AtButton } from 'ta 阅读全文
posted @ 2020-07-06 15:00 chenlw101 阅读(5516) 评论(7) 推荐(1)
refs的用法
摘要:constructor(props){ super(props) this.myRefs = React.createRef(); } refFun(){ const node = this.myRefs.current node.style.color = "red" } render() { r 阅读全文
posted @ 2020-07-03 17:26 chenlw101 阅读(217) 评论(0) 推荐(0)
prop中增加限制与默认prop
摘要:注 : React.PropTypes 在 React v15.5 版本后已经移到了 prop-types 库。 import PropTypes from 'prop-types' render(){ return ( <div> <div>111</div> //子组件可以{...this.pr 阅读全文
posted @ 2020-07-03 16:23 chenlw101 阅读(392) 评论(0) 推荐(0)
子组件传递参数到父组件
摘要://子组件(传参数) < input type = "button" value = "提交" onClick = { ()=>{ this.props.handleChange('123') } } / > //子组件(传输入值) < input onChange = { this.props.h 阅读全文
posted @ 2020-07-03 15:48 chenlw101 阅读(352) 评论(0) 推荐(0)