1.0.4 • Published 5 years ago

react-input-tag v1.0.4

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

react tags automatic input component.

Installation

npm i react-input-tag -S

Demo

image

Demo link

http://www.liubaitong.com/reactinput/index.html

Usage

import React from 'react'
import ReactDOM from 'react-dom'
import TagsInput from 'react-input-tag' 

class App extends React.Component {
    constructor(props){
        super(props);
    }

    handleChangeTags(tags){
        console.log(tags)  
    }

    render() { 
        return  <TagsInput 
                onChange={(tags) => this.handleChangeTags(tags)}
            />
    }
} 

API

PropTypeDefaultDescription
defaultTagsarray[]组件初始显示标签项
onChangefuncRequired组件标签项发生改变时触发的回调函数
placeholderstring""组件placeholder
ruleobjectnull校验标签内容正则
errTipstring""标签内容不匹配正则时的提示语,默认不提示
fullColorboolfalse随机彩色标签

License

MIT

1.0.4

5 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago