Vue-tag-selector is a component for vuejs for tag type fields. Light (4.4kb gzipped) and customizable. Offering regex validation.
# with npm npm install --save vue-tag-selector # with yarn yarn add vue-tag-selector 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>Here's a list of the props available:
label: Displays a label, has to be String can be ignoredname: 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
Created by Tom Quinonero
