1.8.24 • Published 6 months ago

@antdp/user-login v1.8.24

Weekly downloads
9
License
MIT
Repository
github
Last release
6 months ago

@antdp/user-login

npm npm download

登录界面

Installation

npm i @antdp/user-login --save

Basic Usage

import React, { useRef } from 'react';
import UserLogin from '@antdp/user-login';
import logo from './logo.svg';

export default (props) => {
  const baseRef = useRef();
  const TYPE = 'both';
  return (
    <UserLogin
      logo={logo}
      projectName="Ant Design"
      loading={props.loading}
      onFinish={(values) => {
        let params;
        if (TYPE === 'both') {
          params =
            baseRef?.current?.state?.key === '1'
              ? { username: values?.username, password: values?.password }
              : { phone: values?.phone, code: values?.code };
        } else {
          params = values;
        }
        props.dispatch({
          type: 'global/login',
          payload: params,
        });
      }}
      type={TYPE}
      onSend={() => console.log('短信验证回调')}
      formBtns={[
        {
          label: '登录',
          attr: {
            type: 'primary',
            htmlType: 'submit',
            style: {
              marginRight: 20,
            },
          },
        },
        {
          label: '重置',
          attr: {
            type: 'primary',
          },
        },
      ]}
    />
  )
};

Props

import React from 'react';
import { FormProps, FormItemProps } from 'antd/lib/form';
import { InputProps } from 'antd/lib/input';


export interface formItem extends FormItemProps {
  inputProps?: InputProps;
}

export interface UserLoginProps extends FormProps{
  /**
   * 项目logo
   */
  logo?: JSX.Element;
  /**
   * 项目名称
   */
  projectName?: string;
  className?: string;
  loading?: boolean;
  formItems?: formItem[];
  // 短信登陆 表单
  phoneFormItems?:formItem[];
  // 短信验证form.item属性
  phoneCodeProps?:formItemProps
  // 验证短信回调
  onSend ?: () => void
  // 手机登陆|账号登陆|账号手机登陆
  type?:'phone' | 'account' | 'both',
  // 登陆组件额外jsx.element
  children?:JSX.Element;
  // 表单内部额外jsx.element
  formChildren?:JSX.Element;
}
1.8.20

7 months ago

1.8.21

7 months ago

1.8.22

7 months ago

1.8.23

6 months ago

1.8.24

6 months ago

1.8.17

10 months ago

1.8.18

10 months ago

1.8.19

10 months ago

1.8.16

12 months ago

1.8.15

1 year ago

1.8.14

1 year ago

1.8.13

1 year ago

1.8.12

1 year ago

1.8.11

1 year ago

1.8.9

1 year ago

1.8.10

1 year ago

1.8.8

1 year ago

1.8.7

1 year ago

1.8.6

1 year ago

1.8.2

1 year ago

1.8.5

1 year ago

1.8.4

1 year ago

1.8.3

1 year ago

1.8.1

1 year ago

1.8.0

1 year ago

1.7.0

1 year ago

1.6.19

1 year ago

1.6.17

1 year ago

1.6.16

1 year ago

1.6.18

1 year ago

1.6.15

1 year ago

1.6.14

1 year ago

1.6.11

1 year ago

1.6.13

1 year ago

1.6.4

1 year ago

1.6.9

1 year ago

1.6.8

1 year ago

1.6.10

1 year ago

1.6.7

1 year ago

1.6.6

1 year ago

1.6.5

1 year ago

1.6.3

1 year ago

1.6.2

1 year ago

1.6.0

1 year ago

1.5.4

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.12

2 years ago

1.3.11

2 years ago

1.3.10

2 years ago

1.3.9

2 years ago

1.3.7

2 years ago

1.3.8

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.0

2 years ago

1.2.1

2 years ago

1.1.23

2 years ago

1.1.22

2 years ago

1.1.21

2 years ago