Coder Social home page Coder Social logo

codexp / vue-tagsinput Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ginhing/vue-tagsinput

0.0 2.0 0.0 215 KB

A tags input component based on Vue.js

Home Page: https://vue-tagsinput.surge.sh/

License: MIT License

Vue 69.83% JavaScript 28.37% HTML 1.80%

vue-tagsinput's Introduction

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

vue-tagsinput's People

Contributors

belinchung avatar icebob avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.