@5rabbits/time-input 中文文档教程

发布于 5年前 浏览 25 项目主页 更新于 3年前

@5rabbits/time-input npmTravisCodecov

00h 00m 格式输入的时间。

Usage

  • Install with yarn add @5rabbits/time-input.
  • Install peer dependencies (if you haven't already) yarn add react@^16.0.0 react-dom@^16.0.0. React 15 is also supported.
  • Use the component:
import TimeInput from '@5rabbits/time-input'

<TimeInput />

Demo

Props

proptypedefaultrequireddescription
clearablebooltrueIf true the input can be emptied (notifying value null). If false when the user tries to clear the text it will be set to 0.
defaultValuenumberThe initial value in minutes to use as an uncontrolled input.
onChangefuncCallback that will be invoked when the value changes. The first argument will be the new value in minutes.
valuenumberThe value in minutes to use as a controlled input.

Development

  • Run yarn start to start building the library in watch mode.
  • Write stories in the stories/index.js file.
  • Run yarn publish to release a new version.

这个项目lints提交前自动美化源文件。

@5rabbits/time-input npmTravisCodecov

A time input in 00h 00m format.

Usage

  • Install with yarn add @5rabbits/time-input.
  • Install peer dependencies (if you haven't already) yarn add react@^16.0.0 react-dom@^16.0.0. React 15 is also supported.
  • Use the component:
import TimeInput from '@5rabbits/time-input'

<TimeInput />

Demo

Props

proptypedefaultrequireddescription
clearablebooltrueIf true the input can be emptied (notifying value null). If false when the user tries to clear the text it will be set to 0.
defaultValuenumberThe initial value in minutes to use as an uncontrolled input.
onChangefuncCallback that will be invoked when the value changes. The first argument will be the new value in minutes.
valuenumberThe value in minutes to use as a controlled input.

Development

  • Run yarn start to start building the library in watch mode.
  • Write stories in the stories/index.js file.
  • Run yarn publish to release a new version.

This project lints and prettifies source files automatically before commiting.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文