This commit is contained in:
parent
add1a74fc2
commit
b837423b6b
|
@ -155,6 +155,7 @@ export default class form extends React.Component {
|
||||||
|
|
||||||
validator() {
|
validator() {
|
||||||
console.log("表单验证")
|
console.log("表单验证")
|
||||||
|
console.log(this.props.model)
|
||||||
let doms = document.getElementsByClassName("form-Item");
|
let doms = document.getElementsByClassName("form-Item");
|
||||||
let self = this;
|
let self = this;
|
||||||
for (let i = 0; i < doms.length; i++) {
|
for (let i = 0; i < doms.length; i++) {
|
||||||
|
@ -168,8 +169,6 @@ export default class form extends React.Component {
|
||||||
let rules_item = _.get(this.state.rules, formItem.props.prop)
|
let rules_item = _.get(this.state.rules, formItem.props.prop)
|
||||||
if (rules_item) {
|
if (rules_item) {
|
||||||
for (let j = 0; j < rules_item.length; j++) {
|
for (let j = 0; j < rules_item.length; j++) {
|
||||||
|
|
||||||
|
|
||||||
if (rules_item[j].type == "required") {
|
if (rules_item[j].type == "required") {
|
||||||
console.log("当前值")
|
console.log("当前值")
|
||||||
console.log(formItem_com.value)
|
console.log(formItem_com.value)
|
||||||
|
@ -182,7 +181,6 @@ export default class form extends React.Component {
|
||||||
else{
|
else{
|
||||||
self.removeClasss(item)
|
self.removeClasss(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rules_item[j].type == "regExp") {
|
if (rules_item[j].type == "regExp") {
|
||||||
|
|
|
@ -83,6 +83,7 @@ import classNames from 'classnames'
|
||||||
clearItem(){
|
clearItem(){
|
||||||
this.setState({iptVal:''});
|
this.setState({iptVal:''});
|
||||||
this.setState({iptVallength:0});
|
this.setState({iptVallength:0});
|
||||||
|
this.props.onClearItem();
|
||||||
}
|
}
|
||||||
// 焦点事件,伸展宽度
|
// 焦点事件,伸展宽度
|
||||||
focusFn(e){
|
focusFn(e){
|
||||||
|
|
Loading…
Reference in New Issue