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-tag-editor-set

v1.0.5

Published

A Vue.js component for creating tag editor.

Downloads

8

Readme

vue-tag-editor-set

npm version Build Status Coverage Status Maintainability MIT License

NPM

A Vue.js component for creating tag editor. Easy to use by providing simple api. And you can customize the style of this component by css.

Installation

Install the npm package.

$ npm install vue-tag-editor-set --save

Register the component.

import { VueTagEditor, VueTagEditorBulma } from 'vue-tag-editor'  #if you want to use bulma design component, include VueTagEditorBulma

Vue.component('tag-editor', VueTagEditor)
Vue.component('tag-editor-bulma', VueTagEditorBulma)

Demo

You can see the demo for quickly understand how to use this package.

$ git clone [email protected]:yukihirop/vue-tag-editor.git
$ cd vue-tag-editor
$ npm install
$ npm run demo

Check the code from ./demo/index.html and ./demo/App.vue.

Support Component

  • VueTagEditor
  • VueTagEditorBulma

Usage

Basic Usage (Case When VueTagEditor)

<!-- when type is label -->
<tag-editor
  :tags="tagLabels"
  :type="'label'"
  @handler-after-input-tag="handlerAfterInputTag"
  @handler-after-delete-tag="handlerAfterDeleteTag"
/>

<!-- when type is link -->
<!-- handler-after-click-tag is effective only when type is 'link' -->
<tag-editor
  :tags="tagLinks"
  :type="'link'"
  @handler-after-click-tag="handlerAfterClickTag"
  @handler-after-input-tag="handlerAfterInputTag"
  @handler-after-delete-tag="handlerAfterDeleteTag"
/>

Example

<template>
  <tag-editor
    :tags="tags"
    :type="'link'"
    @handler-after-click-tag="handlerAfterClickTag"
    @handler-after-input-tag="handlerAfterInputTag"
    @handler-after-delete-tag="handlerAfterDeleteTag"
  />
</template>

<script>
export default {
  data(){
    return {
      tags: ['javascript', 'ruby']
    }
  },
  methods: {
    // Only one argument
    handlerAfterClickTag(tag){
      alert(tag + ' is click!')
    },
    // Only two argument
    handlerAfterInputTag(tag, isAddTag){
      if (isAddTag === true) {
        console.log(tag + ' is added!')
      } else {
        console.log(tag + ' isn\'t added')
      }
    },
    // Only one argument
    handlerAfterDeleteTag(tag){
      console.log(tag + ' is deleted!')
    }
  }
}
</script>

Props

There is no required props. all optional.

|Name|Type|Description|Remarks| |----|----|-----------|-------| |tags|Array|tags to display. default is [].| |type|String|type of tag. default is label.|label or link.| |tag-area-class|String|CSS class name for tag span.|Only VueTagEditor| |tag-content-class|String|CSS class name for tag label (when type is label) or a (when type is link).|Only VueTagEditor| |delete-area-class|String|CSS class name for tag delete button.|Only VueTagEditor| |delete-content-class|String|CSS class name for tag delete button text.|Only VueTagEditor| |input-content-class|String|CSS class name for tag input.| |tag-custom-class|String|CSS class name for tag span.When you want to overwrite css of VueTagEditorBulma and so on.| |placeholder|String|Input placeholer message. default is Add tags....| |@handler-after-click-tag|Function|The method to call when tag clicked. Use clicked tagname as parameter.|Only effective when type is link| |@handler-after-input-tag|Function|The method to call when tag inputed. Use inputed tagname and success or failure as parameter.| |@handler-after-delete-tag|Function|The method to call when tag deleted. Use deleted tagname as parameter.|

Note