.replace(/\s+/g, '')
Number()
.toFixed(2)
String()
Array()
maxLength={10}
let valueInput = this.props.form.getFieldsValue(); valueInput就是全部输入框的值. this.props.form.validateFieldsAndScroll((err, values) => { if(!err){ 在这里作处理.要避开错误. } )}
onChange={e =>this.onChange(e)}
onBlur={e =>this.onBlur(e)}
fontWeight: 300
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
border-bottom: 1px solid #e8e8e8;
maskClosable:true
思路:找到点击登陆的方法,查看方法发的请求.在发请求的里面去当作功后跳转至哪里了,若是没有就去model层看,可能在model层的callback里面处理了.前端
// 点击登陆的方法 handleSubmit = e => { e.preventDefault(); this.props.form.validateFields((err, values) => { if (!err) { if (this.state.isRemember === true) { setCookie('userName', values.username, 7) setCookie('password', values.password, 7) this.setState({ initialStateAutoL: true }) } let datas = { captcha: values.captcha, password: values.password, userName: values.username, uuid: this.props.login.captchaToken, }; this.props.dispatch({ type: `login/goLogin`, payload: datas, }); } }); }; model层: // 登陆 *goLogin({ payload }, { call }) { const ret = yield call(login, payload); const { code, data } = ret; if (code === '0000') { if (data.token) { localStorage.setItem('token', data.token); } // 在这里跳转的 router.push({pathname:'/home'}); } },
设置initialValue的时候,若是是空字符串,或者null.设置placeholder都不会生效!!! 必定要设置成undefined!!!! 只有是undefined的时候,placeholder才会生效!!!!git
能够这样写:initialValue: repCode || undefined,这样写的意思就是,不论repCode是空字符串仍是null仍是 undefined,都会取undefined.
原理2-52位精确
解决方法:值先除以100再乘以100.github
data.substring(0,10) data表明须要截取的字段,0表明从第一位开始,10表明截取的最后位置.
table的rowClassName属性就是给选中的行增长样式的. 返回值是string. 括号里的两个参数:record:列表的参数,index:下标 styles.active就是less文件里的样式名. 我用过了record.id也用过index,我都贴出来: rowClassName={(record,index)=>{ let className; if(String(this.state.list) === record.id){ className = styles.active } return className; }} rowClassName={(record,index)=>{ let className; if(Number(this.state.val) === (index+1)){ className = styles.active } return className; }} 若是是list列表增长的话能够用为伪类方便一些.
F11
文件->首选项->设置 ->搜索 files.autoGuessEncoding 不保持选中状态
height:calc(100vh - 330px) calc():计算工具 100vh:屏幕高度
特别是移动端,常常会遇到Flex布局下文字被覆盖.可是设置不少属性值都么有用. 直到最后发现.是父元素的高度影响了子元素.
NaN,如何产生? NaN === NaN ? NaN是数字类型的,全称为:Not a Number .可是它又能够用isNaN()检测,isNaN() 函数用于检查其参数是不是非数字值
console.log('%c\ud83d\uDCA1 返回错误 ', 'background:#000;color:#f0f360',11111111111111);
console.log('%c\ud83d\uDC4C 请求成功 ', 'background:#000;color:#a9ef87', response);
console.log( `%c\ud83d\uDE80 reuqest ${config.method} `, 'background:#000;color:#b1dcff', config.url, );
console.log('%c\ud83d\uDD25 请求失败 ', 'background:#000;color:#f0f360',11111111111111);
opacity: 0.3
~~~~后端