npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-tags

v1.0.4

Published

Vue.js input tag editor component

Downloads

269

Readme

Vue-Tags

A Flexible Vue.js 2 input Tag component where you can edit wathever you like related to HTML/CSS.

Demo

Demo

Installation :

npm install vue-tags

Getting Started

In your script entry point:

<div id="app">

  <input-tags v-model="tags">
    <div class="tags-input"
            slot-scope="{tag,removeTag,inputEventHandlers,inputBindings }">
            <span v-for="tag in tags"
              class="tags-input-tag">
              <span>{{ tag }}</span>
              <button type="button" class="tags-input-remove"
                v-on:click="removeTag(tag)"
              >&times;
             </button>
            </span>
            <input
              class="tags-input-text"  placeholder="Add tag..."
              v-on="inputEventHandlers"
              v-bind="inputBindings"
            >
          </div>
   </input-tags>

</div>

window.Vue = require("vue");

import VueTags from "vue-tags";

//Vue.component("input-tags", VueTags); If you want a global Component

const app = new Vue({
  el: "#app",
  components: {
    VueTags
  },
  data: {
    tags: ['Laravel','Vuejs'],
  }
});

Usage

Just add the tags as a v-model and follow the code above just don't change the vuejs attributes and the others is your choice do wathever you want with them.

Props

By Default The tag is added when you click the Enter Key but you can customize it by adding addKey prop with KeyCode of your choice. You can have it here. For Example 188 for Comma ,

<div id="app">

  <input-tags v-model="tags" :addKey="188">
    <div class="tags-input"
            slot-scope="{tag,removeTag,inputEventHandlers,inputBindings }">
            <span v-for="tag in tags"
              class="tags-input-tag">
              <span>{{ tag }}</span>
              <button type="button" class="tags-input-remove"
                v-on:click="removeTag(tag)"
              >&times;
             </button>
            </span>
            <input
              class="tags-input-text"  placeholder="Add tag..."
              v-on="inputEventHandlers"
              v-bind="inputBindings"
            >
          </div>
   </input-tags>

</div>

const app = new Vue({
  el: "#app",
  components: {
    VueTags
  },
  data: {
    tags: ['Laravel','Vuejs'],
  }
});

By Default The tag is deleted when you click delete Key but you can customize it by adding deleteKey prop with KeyCode of your choice. You can have it here. For Example 13 for Comma Enter Now When we click Enter we delete the tag

<div id="app">

  <input-tags v-model="tags" :deleteKey="13">
    <div class="tags-input"
            slot-scope="{tag,removeTag,inputEventHandlers,inputBindings }">
            <span v-for="tag in tags"
              class="tags-input-tag">
              <span>{{ tag }}</span>
              <button type="button" class="tags-input-remove"
                v-on:click="removeTag(tag)"
              >&times;
             </button>
            </span>
            <input
              class="tags-input-text"  placeholder="Add tag..."
              v-on="inputEventHandlers"
              v-bind="inputBindings"
            >
          </div>
   </input-tags>

</div>

const app = new Vue({
  el: "#app",
  components: {
    VueTags
  },
  data: {
    tags: ['Laravel','Vuejs'],
  }
});

Contributing

You are more than welcome to contribute to this repo with anything you think is useful. fixes are more than welcome.