Socket
Book a DemoInstallSign in
Socket

@antdp/user-login

Package Overview
Dependencies
Maintainers
2
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antdp/user-login

用户登录页面

Source
npmnpm
Version
2.0.23
Version published
Weekly downloads
1
-99.16%
Maintainers
2
Weekly downloads
 
Created
Source

@antdp/user-login

npm npm download

登录界面

Installation

$ npm i @antdp/user-login --save

基本使用

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

const Demo= (props) => {
  return (
    <UserLogin
      warpStyle={{minHeight:"300px"}}
      projectName="Ant Design"
      loading={props.loading}
      onFinish={(values,submitType) => {
        console.log("打印保存参数---->",value,submitType)
      }}
      onSend={() => console.log('短信验证回调')}
      formBtns={[
        {
          label: '登录',
          attr: {
            type: 'primary',
            htmlType: 'submit',
            style: {
              marginRight: 20,
            },
          },
        },
        {
          label: '重置',
          attr: {
            type: 'primary',
          },
        },
      ]}
    />
  )
}
export default Demo;

账号登录

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

const Demo= (props) => {
  return (
    <UserLogin
      warpStyle={{minHeight:"300px"}}
      projectName="Ant Design"
      loading={props.loading}
      onFinish={(values) => {
       console.log("打印保存参数---->",values)
      }}
      type="account"
      formBtns={[
        {
          label: '登录',
          attr: {
            type: 'primary',
            htmlType: 'submit',
            style: {
              marginRight: 20,
            },
          },
        },
        {
          label: '重置',
          attr: {
            type: 'primary',
          },
        },
      ]}
    />
  )
}
export default Demo;

手机号登录

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

const Demo= (props) => {
  return (
    <UserLogin
      warpStyle={{minHeight:"300px"}}
      projectName="Ant Design"
      loading={props.loading}
      onFinish={(values) => {
       console.log("打印保存参数---->",values)
      }}
      type="phone"
      onSend={() => console.log('短信验证回调')}
      formBtns={[
        {
          label: '登录',
          attr: {
            type: 'primary',
            htmlType: 'submit',
            style: {
              marginRight: 20,
            },
          },
        },
        {
          label: '重置',
          attr: {
            type: 'primary',
          },
        },
      ]}
    />
  )
}
export default Demo;

API

该组件依赖

参数说明类型默认值
logologostring-
projectName项目名称string-
className登陆样式string-
type登录类型account | phone | account
children自定义内容React.ReactNode-
formItems账号登录设置的formItem({ render?: React.ReactNode, inputProps?: InputProps } & FormItemProps)[]-
formBtns表单操作按钮{ label?: React.ReactNode, attr?: ButtonProps }[]-
loading加载状态boolean-
onFinish表单提交(value: any, submitType: "account" | "phone") => void-
phoneFormItems手机号登录设置的 formItem 项UserLoginProps["formItems"]-
phoneCodeProps手机号FormItem 属性FormItemProps-
onSend自定义form表单内渲染() => void-
warpStyle外层样式React.CSSProperties-
titleStyle标题样式React.CSSProperties-

Keywords

login

FAQs

Package last updated on 10 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts