How to use the rc-form.createForm function in rc-form

To help you get started, we’ve selected a few rc-form examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 1067011734 / balibali / src / pages / User / model / step1.js View on Github external
import React, { Component } from 'react'
import { List, InputItem, Switch, Stepper, Range, Button, Picker, Toast } from 'antd-mobile'
import Container from '@/components/Container'
import { createForm } from 'rc-form'
import PropTypes from 'prop-types'

const { Item } = List
@createForm()
class app extends Component {
  PropTypes = {
    onChange: PropTypes.func,
  }

  state = {
  }

  componentDidMount() {
    const { userInfo } = this.props
    const { name, dept } = userInfo
    // debugger
    this.props.form.setFieldsValue({
      name,
      dept: [dept],
    })
github 1067011734 / balibali / src / pages / User / index.js View on Github external
import React, { Component } from 'react'
import { Steps,InputItem,Button,WhiteSpace} from 'antd-mobile'
import Container from '@/components/Container'
import { createForm } from 'rc-form'
import { connect } from 'dva'
import router from 'umi/router'
import Step1 from './model/step1'
import Step2 from './model/step2'
import Step3 from './model/step3'

const {Step} = Steps

@createForm()
@connect(({ common}) => ({
  userInfo:common.userInfo
}))
class app extends Component {
    state = {
      userInfo:{
        name:'', // 姓名
        dept:'', // 所属部门
        person:[], //个性标签
        avatar:"" //头像
      },
      stepNumber:1,
    }

    stepList=[
      {title:'基本设置',key:1},
github duxianwei520 / react-m / app / containers / App / login.js View on Github external
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { List, InputItem, Button } from 'antd-mobile'
import { createForm } from 'rc-form'
import { pageTransition } from 'actions/common'

@createForm()

@connect(
  (state, props) => ({})
)

export default class Login extends Component {
  // 初始化页面常量 绑定事件方法
  constructor(props, context) {
    super(props)
    this.state = {
      loading: false,
    }
  }

  componentWillMount() {
github foolsogood / mall-by-react / client-use-dva / src / components / common / login.tsx View on Github external
import { List, Button, WhiteSpace, WingBlank, InputItem } from "antd-mobile";
import { createForm } from "rc-form";
import event from "utils/event";
import { connect } from "dva";
import Cookies from "js-cookie";
interface Props{
  form?:any,
  dispatch?:(args)=>void
}
interface State{
  isLoginShow: boolean,
}
@connect(({ app }) => ({
  app
}))
@createForm()
class Login extends Component {
  constructor(props) {
    super(props);
    this.state = {
      isLoginShow: false
    };
  }
  componentDidMount() {
    event.on("showLogin", bool => {
      console.log(111111)
      this.setState({ isLoginShow: bool });
    });
  }
  handleSubmit = e => {
    const {
      form: { validateFields, getFieldValue },
github foolsogood / mall-by-react / client-use-dva / src / components / common / signup.tsx View on Github external
import React, { Component } from 'react';
import { List, Button, WhiteSpace, WingBlank, InputItem } from 'antd-mobile';
import { createForm } from 'rc-form';

import event from 'utils/event';
interface Props {
  form?: any;
}
interface State {
  isSignupShow: boolean;
}
@createForm()
class Signup extends Component {
  constructor(props) {
    super(props);
    this.state = {
      isSignupShow: false
    };
  }
  componentDidMount() {
    event.on('showSignup', bool => {
      this.setState({ isSignupShow: bool });
    });
  }
  handleSubmit = e => {
    const {
      form: { validateFields, getFieldValue }
    } = this.props;
github 1067011734 / balibali / src / pages / Login.js View on Github external
import React, { Component } from 'react'
import { InputItem, Button, WhiteSpace, Toast } from 'antd-mobile'
import { createForm } from 'rc-form'
import { connect } from 'dva'
import { loginReg } from '@regularConfig'
import style from '@/styles/login.less'
import avataSrc from '@/images/icon/avatar.png'
import loginUserSrc from '@/images/icon/login_user.png'
import loginPassSrc from '@/images/icon/login_pass.png'
@createForm()
@connect(({ login, loading }) => ({
  login,
  submitting: loading.effects['login/login'],
}))
class app extends Component {
  state = {
  }

  submit = () => {
    const { getFieldProps, getFieldError } = this.props.form
    this.props.form.validateFields((error, values) => {
      if (error) {
        const msg = `请输入${getFieldError('user') || ''}${getFieldError('password') || ''}`
        Toast.info(msg, 1);
        return
      }
github 1067011734 / balibali / src / pages / User / model / step3.js View on Github external
import React, { Component } from 'react'
import { ImagePicker  ,Button } from 'antd-mobile'
import { createForm } from 'rc-form'
import PropTypes from 'prop-types'

@createForm()
class app extends Component {
  PropTypes={
    onChange: PropTypes.func,
  }

    state = {
      files: [],
    }

componentDidMount(){
  const {userInfo} = this.props
  const {avatar} = userInfo
  this.setState({files:[{url:avatar}]})
}

onSubmit = () => {
github ruichengping / react-mobile-qqMusic / src / components / Slider / index.js View on Github external
render() {
        const {docked} = this.props;
        let SwitchExample = (props) => {
            const { getFieldProps } = props.form;
            return (
github foolsogood / mall-by-react / client-use-dva / src / routes / personal / bindPhone.tsx View on Github external
WingBlank,
  InputItem,
  Toast
} from 'antd-mobile';
import { createForm } from 'rc-form';

import { connect } from 'dva';
interface Props {
  app?: any;
  dispatch?: (args) => void;
  form?: any;
}
interface State {
  isCodeBtnEnabled: boolean;
}
@createForm()
@connect(({ app }) => ({ app }))
class BindPhone extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      isCodeBtnEnabled: false
    };
  }
  handleSubmit = (e: React.MouseEvent) => {
    const {
      form: { validateFields, getFieldValue }
    } = this.props;
    e.preventDefault();
    validateFields(async (err, values) => {
      if (!err) {
        const query = {

rc-form

React High Order Form Component

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis