Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nuke-mask

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuke-mask

遮罩层

  • 0.0.6
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Mask

  • category: Components
  • chinese: 遮罩层
  • type: 基本

设计思路

注意,该组件在安卓端存在较多bug,暂不推荐使用。

Mask 是 weex component mask 的封装实现。目前仅支持 native ,h5 无法调用。

API

参数说明类型默认值
style样式object

调用方法

/** @jsx createElement */
import {createElement, Component,render} from 'rax';
import {View,Text,Button,Mask} from 'nuke';
let App = class Demo extends Component {
    constructor() {
        super();
        this.state={
            maskVisible:false
        }
    }
    showMask = ()=>{
        this.setState({
            maskVisible:true
        })
    }
    hideMask =()=>{
        this.setState({
            maskVisible:false
        })
    }
    render() {
        return (
            <View style={styles.containner}>
                <Button type="primary" onPress={this.showMask}>打开浮层</Button>
                {
                    this.state.maskVisible ?
                    <Mask>
                        <View style={styles.bg}>
                            <Text style={styles.text}>遮罩层里的内容</Text>
                            <Button type="primary" onPress={this.hideMask}>确认</Button>
                        </View>
                    </Mask>
                    :null
                }
            </View>
        );
    }
}
const styles={
    mask:{
        
    },
    bg:{
        flex:1,
        alignItems: 'center',
        justifyContent: 'center',
        backgroundColor:'rgba(0,0,0,0.7)'

    },
    text:{
        color:'#ffffff'
    }
}
render(<App/>);

Keywords

FAQs

Package last updated on 17 Jul 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc