Skip to content

可限制输入字符的输入框,支持粘贴和中文

Notifications You must be signed in to change notification settings

tkitesy/react-restrict-input

Repository files navigation

react-restrict-input

可限制输入字符的输入框,支持粘贴和中文

NPM JavaScript Style Guide

Install

npm install --save react-restrict-input

Usage

import React, { Component } from 'react'

import { ReactRestrictInput } from 'react-restrict-input'

const App = () => {
  const [value, setValue] = React.useState('')
  return (
    <ReactRestrictInput
      value={value}
      onChange={setValue}
      maxChars={10}
      restrict={/[0-9a-z我]/}
    />
  )
}

License

MIT © tkitesy

About

可限制输入字符的输入框,支持粘贴和中文

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published