Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Ginhing/vue-tagsinput

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This Project Is Deprecated

vue-tagsinput

kerboard supported(left, right, backspace, tab).

Requirement

  • vue: ^2.1.0

Usage

<div id="example">
    <tags-input
        :tags="tags"
        @tags-change="handleChange"
    ></tags-input>
</div>

Example

Live example

Props

  • tags(array<{ text: string, readOnly: ?boolean, invalid: ?boolean }>, required): your tags to render
  • placeholder(string): a hint to the user
  • klass(object): override the class name (see below)

Events

  • tags-change: (index: number, text: ?string) => void text will be undefined if the tag was removed
  • focus: (index: number) => void
  • blur: (index: number) => void

Class Names

{
    container: 'tags-input',
    input: 'input',
    placeholder: 'placeholder',
    gap: 'gap',
    tag: 'tag'
}

Migration from 0.x

Because of the two-way props was obsoleted in Vue@2, we should deal with tags by one-way props and onChange callback explicitly. So most states will be handled in your scope. See the full example.

License

MIT

About

A tags input component based on Vue.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published