npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-uialert

v1.3.3

Published

一个RN提示框

Downloads

85

Readme

React-Native-UIAlert

案例 案例

Props属性说明

| name | type | Default | Extra | --------- |:-----: |:-----: | :----: | myData | Dictionary | {} | 控制显示内容 | id | String | nul | 按钮事件回调时区分那个按钮 | text | String | "" | 提示窗口的内容文案 | buttons | Array | [] | 两个维度的按钮多行多列:[[],[],[]],多行单列:[{},{},{}] | clickBtn | Function | null | 回调方法

使用说明

安装

npm install react-native-uialert --save

引入

import UIAlert from 'react-native-uialert'

Methods

  • showV()//显示(默认是隐藏的)
  • heiV()//隐藏
    //contentText 主体文案的style
	<UIAlert ref = "UIAlert" contentText = {{textAlign:'left'}} clickBtn = {( id, backData )=>{
        //id==myData.buttons.item中的,backData则是showV()传入的数据
    }}/>

    /****
   * 
   * buttons : [item,[item,item,item]]//内部可以是oject()或者array(一行多个)
   * 
   * item : {
   *      title : 按钮文案
   *      titleColor : 文字颜色
   *      backgroundColor : 按钮背景色
   *      id : 区分回调
   * }
   * 
   * 
   */
//this.refs.UIAlert.showV( myData, backData )
if (this.refs.UIAlert) {
  this.refs.UIAlert.showV( {
      title: "title",//通知标题
      text: "text",//内容
      buttons: [{
          title: "b1",
          titleColor: WHITE_COLOR,
          backgroundColor: YELLOW_COLOR,
          id:1,
        },[{
          title: "b1",
          titleColor: WHITE_COLOR,
          backgroundColor: YELLOW_COLOR,
          id:1
        },{
          title: "b2",
          titleColor: WHITE_COLOR,
          backgroundColor: YELLOW_COLOR,
          id:2
      },{
          title: "b3",
          titleColor: WHITE_COLOR,
          backgroundColor: YELLOW_COLOR,
          id:2
      }]]
  } )
}

UIButton

属性说明

| Name | Type | Default | Extra | :----: | :----: | :----: | :----: | name | String | "" | 按钮的文字 | selected | Boolean | false | 选择中或非选中按钮状态 | tagId | id | null | 按钮的标识 | styles | Dictionary | {} | 按钮的样式 | onPress | Function | null | 按钮触发返回tagId

使用

    import { UIButton } from 'react-native-uialert'
       <View style={{ margin:5, height:35, }}>
            <UIButton
                name={ title }
                tagId = {id}
                onPress={(tagId)=>{
                    this.cancel(tagId);
                }}
                styles={{
                    backgroundColor:backgroundColor,
                    borderRadius:5,
                    fontSize:12,
                    titleColor:titleColor
                }}
            />
        </View>