文章分类 - react
摘要:form 表单动态跟新值 setFieldsValue getFieldsValue this.refs.basic_form.setFieldsValue({thumbnails:path}) this.refs.basic_form.getFieldsValue(“thumbnails”) 4.
阅读全文
摘要:eact-id-swiper,react-animated-slider ,react-slick用react实现轮播效果,代码完整,直接复制下来就能运行(推荐最后一个): https://blog.csdn.net/qq_37815596/article/details/86293569 reac
阅读全文
摘要:1、使用import引入 import img1 from '../assets/img/img1.jpg' //引入 ··· <img src={img1} /> //使用 2、使用require引入 <img src={require('../assets/img/img1.jpg')} />
阅读全文
摘要:1、error事件(img标签加载失败的方法) imgErro=(event)=>{ var e=window.event||event; //消除浏览器差异 const defaultImg="https://m.media-amazon.com/images/M/MV5BMTQ2MTI2OTEw
阅读全文
摘要:react 父域部分 export default class ParentComponent extends React.Component { componentDidMount() { window.onmessage = e => { //监听message事件 if (e.data 'lo
阅读全文
摘要:1、安装expose-loader npm install --save expose-loader2、在webpack.config中加入下面这段loader代码 { test: require.resolve(‘jquery‘), use: [{ loader: ‘expose-loader‘,
阅读全文
摘要:老版本添加方法: 在 module.exports 的 plugins 下添加 /*压缩*/ new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false, drop_debugger: true, //输出文件不debugger
阅读全文
摘要:/** 监听路由变化 */ /** 监听路由变化 */ history.listen((location, action) => { console.log('location:', location); console.log('action', action); }); 使用history对象来
阅读全文
posted @ 2018-10-26 15:04
huihui2014
摘要:指定404页面 指定404页面也非常简单,只需要在路由系统最后使用Route指定404页面的component即可 重定向 Redirect <Switch> <Route path="/" exact component={Home}/> <Route path="/user" component
阅读全文
posted @ 2017-11-15 15:16
huihui2014
摘要:import DatePicker from 'react-mobile-datepicker'; 使用 <Datepacks defaultValue={queryMonth.endDate} minDate={queryMonth.startDate} onSelect={val=>{this.
阅读全文
posted @ 2017-06-18 20:11
huihui2014

浙公网安备 33010602011771号