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

bee-switch

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bee-switch - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

changelog.md

4

demo/demolist/Demo1.js

@@ -7,2 +7,4 @@ /**

*/
import React, { Component } from 'react';
import Switch from '../../src';

@@ -21,1 +23,3 @@ class Demo1 extends Component {

}
export default Demo1;

@@ -8,2 +8,6 @@ /**

import React, { Component } from 'react';
import {Row, Col } from 'bee-layout';
import Switch from '../../src';
class Demo2 extends Component {

@@ -27,1 +31,3 @@

}
export default Demo2;

@@ -8,2 +8,6 @@ /**

import React, { Component } from 'react';
import {Row, Col } from 'bee-layout';
import Switch from '../../src';
class Demo3 extends Component {

@@ -38,1 +42,3 @@ constructor(props){

}
export default Demo3;

82

demo/index.js

@@ -15,85 +15,5 @@

/**
*
* @title 默认开关
* @description
*
*/
var Demo1 = require("./demolist/Demo1");var Demo2 = require("./demolist/Demo2");var Demo3 = require("./demolist/Demo3");var DemoArray = [{"example":<Demo1 />,"title":" 默认开关","code":"/**\n *\n * @title 默认开关\n * @description \n *\n */\nimport React, { Component } from 'react';\nimport Switch from 'tinper-bee';\n\nclass Demo1 extends Component {\n render () {\n return (\n <div>\n <Switch />\n <Switch defaultChecked={true}/>\n <Switch checked/>\n </div>\n \n )\n }\n}\n\n","desc":" "},{"example":<Demo2 />,"title":" 不同大小的开关","code":"/**\n *\n * @title 不同大小的开关\n * @description 通过`size`属性控制开关的大小\n *\n */\n\nimport React, { Component } from 'react';\nimport {Row, Col } from 'bee-layout';\nimport Switch from 'tinper-bee';\n\nclass Demo2 extends Component {\n\n render () {\n return (\n <Row>\n <Col sm={2}>\n <Switch checked={true} size='sm' />\n </Col>\n <Col sm={2}>\n <Switch checked={true} />\n </Col>\n <Col sm={2}>\n <Switch checked={true} size='lg' />\n </Col>\n </Row>\n )\n }\n}\n\n","desc":" 通过`size`属性控制开关的大小"},{"example":<Demo3 />,"title":" 事件开关","code":"/**\n *\n * @title 事件开关\n * @description 点击开关触发事件\n *\n */\n\nimport React, { Component } from 'react';\nimport {Row, Col } from 'bee-layout';\nimport Switch from 'tinper-bee';\n\nclass Demo3 extends Component {\n constructor(props){\n super(props);\n this.state = {\n switch : \"\",\n checked: false\n };\n this.changeHandle = this.changeHandle.bind(this);\n }\n changeHandle(e){\n\t\tthis.setState({\n switch: `${e}`,\n checked: !this.state.checked\n })\n\t}\n\n render () {\n return (\n <Row>\n <Col sm={2}>\n <Switch defaultChecked={this.state.checked} onChangeHandler = {this.changeHandle} checkedChildren={'on'} unCheckedChildren={'off'} />\n </Col>\n <Col sm={2}>\n <span>{ this.state.switch }</span>\n </Col>\n </Row>\n )\n }\n}\n\n\n","desc":" 点击开关触发事件"}]
class Demo1 extends Component {
render () {
return (
<div>
<Switch />
<Switch defaultChecked={true}/>
<Switch checked/>
</div>
)
}
}
/**
*
* @title 不同大小的开关
* @description 通过`size`属性控制开关的大小
*
*/
class Demo2 extends Component {
render () {
return (
<Row>
<Col sm={2}>
<Switch checked={true} size='sm' />
</Col>
<Col sm={2}>
<Switch checked={true} />
</Col>
<Col sm={2}>
<Switch checked={true} size='lg' />
</Col>
</Row>
)
}
}
/**
*
* @title 事件开关
* @description 点击开关触发事件
*
*/
class Demo3 extends Component {
constructor(props){
super(props);
this.state = {
switch : "",
checked: false
};
this.changeHandle = this.changeHandle.bind(this);
}
changeHandle(e){
this.setState({
switch: `${e}`,
checked: !this.state.checked
})
}
render () {
return (
<Row>
<Col sm={2}>
<Switch defaultChecked={this.state.checked} onChangeHandler = {this.changeHandle} checkedChildren={'on'} unCheckedChildren={'off'} />
</Col>
<Col sm={2}>
<span>{ this.state.switch }</span>
</Col>
</Row>
)
}
}
var DemoArray = [{"example":<Demo1 />,"title":" 默认开关","code":"/**\n *\n * @title 默认开关\n * @description \n *\n */\n\nclass Demo1 extends Component {\n render () {\n return (\n <div>\n <Switch />\n <Switch defaultChecked={true}/>\n <Switch checked/>\n </div>\n \n )\n }\n}\n","desc":" "},{"example":<Demo2 />,"title":" 不同大小的开关","code":"/**\n *\n * @title 不同大小的开关\n * @description 通过`size`属性控制开关的大小\n *\n */\n\nclass Demo2 extends Component {\n\n render () {\n return (\n <Row>\n <Col sm={2}>\n <Switch checked={true} size='sm' />\n </Col>\n <Col sm={2}>\n <Switch checked={true} />\n </Col>\n <Col sm={2}>\n <Switch checked={true} size='lg' />\n </Col>\n </Row>\n )\n }\n}\n","desc":" 通过`size`属性控制开关的大小"},{"example":<Demo3 />,"title":" 事件开关","code":"/**\n *\n * @title 事件开关\n * @description 点击开关触发事件\n *\n */\n\nclass Demo3 extends Component {\n constructor(props){\n super(props);\n this.state = {\n switch : \"\",\n checked: false\n };\n this.changeHandle = this.changeHandle.bind(this);\n }\n changeHandle(e){\n\t\tthis.setState({\n switch: `${e}`,\n checked: !this.state.checked\n })\n\t}\n\n render () {\n return (\n <Row>\n <Col sm={2}>\n <Switch defaultChecked={this.state.checked} onChangeHandler = {this.changeHandle} checkedChildren={'on'} unCheckedChildren={'off'} />\n </Col>\n <Col sm={2}>\n <span>{ this.state.switch }</span>\n </Col>\n </Row>\n )\n }\n}\n","desc":" 点击开关触发事件"}]
class Demo extends Component {

@@ -100,0 +20,0 @@ constructor(props){

{
"name": "bee-switch",
"version": "0.2.2",
"version": "0.2.3",
"description": "switch ui component for react",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

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