You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

nuke-switch

Package Overview
Dependencies
Maintainers
3
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuke-switch

开关


Version published
Maintainers
3
Created

Readme

Source

Switch

  • category: Components
  • chinese: 开关
  • type: 基本

何时使用

Switch 是状态切换的开关按钮组件。

API

注意:Switch 在客户端上是个非受控组件

属性说明类型默认值
type展现 安卓 还是 iOS 风格,如果不传,默认根据设备自动切换,可选 android iOS
disabled开关是否可交互booleantrue
defaultChecked默认是否选中(非受控用法)booleanfalse
onValueChangeSwitch 改变时调用此函数function(value)

Demo

非受控用法: 组件自身自由改变,并通过事件通知外部改变成了什么。如下 demo :

change = (value) => {
    console.log('switch 改变成了:',value);
}
//...
render(){
    return (<Switch defaultChecked={true} onValueChange={this.change}/>)
}

其他

  • bug、建议联系 @翊晨
  • 钉钉交流群

Keywords

FAQs

Package last updated on 26 Sep 2019

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc