@3beeepb/react-native-prompt 中文文档教程

发布于 4年前 浏览 21 项目主页 更新于 3年前

react-native-prompt npm versionNPM

React Native 的跨平台(iOS / Android)提示组件。

Add it to your project

  1. 运行 npm install @3beeepb/react-native-prompt --save

  2. 导入库

    import Prompt from '@3beeepb/react-native-prompt';
    
  3. 像这样使用它:

    <Prompt
      titleText={'What is your name?'}
      onCancel={() => console.log('cancel')}
      onDone={() => console.log('done')}
    >
        <TextInput />
    </>
    

Properties

NameDescriptionType
titleTextTitle textstring
cancelTextCancel button textstring
doneTextDone button textstring
titleTextStyleTitle text stylesStyleSheet
cancelTextStyleCancel button text stylesStyleSheet
doneTextStyleDone button text styleStyleSheet
onCancelWill be called when a user press left (Cancel) button.() => void
onDoneWill be called when a user press right (Done/OK) button.() => void

Contribution

请确保在通过运行 npm test。

react-native-prompt npm versionNPM

A cross-platform (iOS / Android) prompt component for React Native.

Add it to your project

  1. Run npm install @3beeepb/react-native-prompt --save

  2. Import the library

    import Prompt from '@3beeepb/react-native-prompt';
    
  3. Just use it like this:

    <Prompt
      titleText={'What is your name?'}
      onCancel={() => console.log('cancel')}
      onDone={() => console.log('done')}
    >
        <TextInput />
    </>
    

Properties

NameDescriptionType
titleTextTitle textstring
cancelTextCancel button textstring
doneTextDone button textstring
titleTextStyleTitle text stylesStyleSheet
cancelTextStyleCancel button text stylesStyleSheet
doneTextStyleDone button text styleStyleSheet
onCancelWill be called when a user press left (Cancel) button.() => void
onDoneWill be called when a user press right (Done/OK) button.() => void

Contribution

Please make sure to run the tests before proposing a PR by running npm test.

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