@jswork/react-ant-editable-tag

1.0.0 • Public • Published

react-ant-editable-tag

Editable tag for ant.

version license size download

installation

npm install -S antd@3
npm install -S @jswork/react-ant-editable-tag

properties

Name Type Required Default Description
className string false - The extended className for component.
onClose func false noop When click close icon.
value union false - The tag value.
onChange func false noop When value changed.

usage

  1. import css
@import "~@jswork/react-ant-editable-tag/dist/style.css";

// or use sass
@import "~@jswork/react-ant-editable-tag/dist/style.scss";

// customize your styles:
$react-ant-editable-tag-options: ()
  1. import js
import ReactDemokit from '@jswork/react-demokit';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactAntEditableTag from '@jswork/react-ant-editable-tag';
import './assets/style.scss';

class App extends React.Component {
  state = { value: 'tagvalue' };

  setRandomValue = () => {
    this.setState({
      value: (Math.random() + 'value').slice(0, 5)
    });
  };

  render() {
    const { value } = this.state;
    return (
      <ReactDemokit
        className="p-3 app-container"
        url="https://github.com/afeiship/react-ant-editable-tag">
        <button className="button is-primary is-fullwidth mb-2" onClick={this.setRandomValue}>
          SetRandomValue
        </button>
        <ReactAntEditableTag
          value={value}
          onChange={(e) => {
            this.setState({ value: e.target.value });
            console.log(e.target.value);
          }}
        />
      </ReactDemokit>
    );
  }
}

ReactDOM.render(<App />, document.getElementById('app'));

documentation

license

Code released under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @jswork/react-ant-editable-tag

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

20.8 kB

Total Files

7

Last publish

Collaborators

  • afeiship