1.0.2 • Published 4 years ago

@feizheng/react-removable-list v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

react-removable-list

A removable list for react.

installation

npm install -S @feizheng/react-removable-list

properties

propertytypedescription
className--
items--
onChange--
templte--

usage

  1. import css

    @import "~@feizheng/react-removable-list/dist/style.scss";
    
    // customize your styles:
    $react-removable-list-options: ()
  2. import js

    import ReactRemovableList from '../src/main';
    import ReactDOM from 'react-dom';
    import React from 'react';
    import './assets/style.scss';
    
    class App extends React.Component {
      state = {
        items: [
          { value: 'k1', label: 'label111' },
          { value: 'k2', label: 'label222' },
          { value: 'k3', label: 'label333' },
          { value: 'k4', label: 'label444' }
        ]
      };
    
      onChange1 = (inEvent) => {
        console.log('change event:', inEvent.target.value);
      };
    
      render() {
        return (
          <div className="app-container">
            <ReactRemovableList
              onChange={this.onChange1}
              items={this.state.items}
            />
          </div>
        );
      }
    }
    
    ReactDOM.render(<App />, document.getElementById('app'));

documentation