Skip to content

tomquinonero/vue-tag-selector

Repository files navigation

vue-tag-selector

Vue-tag-selector is a component for vuejs for tag type fields. Light (4.4kb gzipped) and customizable. Offering regex validation.

vue-tag-selector demo

Installation

# with npm npm install --save vue-tag-selector # with yarn yarn add vue-tag-selector 

Usage

For using the component you just need to import the component and register it:

import TagSelector from 'vue-tag-selector' export default { components: { TagSelector }, data(){ return { tags: [] } } }

And then use it in your template:

<template> <div class="container"> <tag-selector name="tags" v-model="tags"/> </div> </template>

API Documentation

Here's a list of the props available:

  • label: Displays a label, has to be String can be ignored
  • name: Required. usually the field name.
  • classes: Allows you to add classes to the field. String or Array.
  • regex: A RegExp. Validates every tag and disallow adding if not matching. By default it's alphanumerical only (/^[a-zA-Z0-9]*$/)
  • regexError: The error displayed when the Regex doesn't match

Related

Packagist Issues

on Bundlephobia - on npm

Created by Tom Quinonero

About

A simple tag selector as a vue component.

Resources

License

Stars

Watchers

Forks

Packages

No packages published