.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
~~~~後端