项目作者: afeiship

项目描述 :
Editable tag for ant.
高级语言: JavaScript
项目地址: git://github.com/afeiship/react-ant-editable-tag.git
创建时间: 2020-03-15T05:00:15Z
项目社区:https://github.com/afeiship/react-ant-editable-tag

开源协议:MIT License

下载


react-ant-editable-tag

Editable tag for ant.

@jswork/react-ant-editable-tag"">version
license
size
@jswork/react-ant-editable-tag"">download

installation

  1. npm install -S antd@3
  2. 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

    1. @import "~@jswork/react-ant-editable-tag/dist/style.css";
    2. // or use sass
    3. @import "~@jswork/react-ant-editable-tag/dist/style.scss";
    4. // customize your styles:
    5. $react-ant-editable-tag-options: ()
  2. import js

    1. import ReactDemokit from '@jswork/react-demokit';
    2. import React from 'react';
    3. import ReactDOM from 'react-dom';
    4. import ReactAntEditableTag from '@jswork/react-ant-editable-tag';
    5. import './assets/style.scss';
    6. class App extends React.Component {
    7. state = { value: 'tagvalue' };
    8. setRandomValue = () => {
    9. this.setState({
    10. value: (Math.random() + 'value').slice(0, 5)
    11. });
    12. };
    13. render() {
    14. const { value } = this.state;
    15. return (
    16. <ReactDemokit
    17. className="p-3 app-container"
    18. url="https://github.com/afeiship/react-ant-editable-tag">
    19. <button className="button is-primary is-fullwidth mb-2" onClick={this.setRandomValue}>
    20. SetRandomValue
    21. </button>
    22. <ReactAntEditableTag
    23. value={value}
    24. onChange={(e) => {
    25. this.setState({ value: e.target.value });
    26. console.log(e.target.value);
    27. }}
    28. />
    29. </ReactDemokit>
    30. );
    31. }
    32. }
    33. ReactDOM.render(<App ></App>, document.getElementById('app'));

documentation

license

Code released under the MIT license.