New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dynamic-tag

Package Overview
Dependencies
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamic-tag

<!-- * @Author: your name * @Date: 2021-01-20 10:21:21 * @LastEditTime: 2021-03-16 16:19:14 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: \dynamic-tag\README.md --> # dynamic-tag

  • 0.2.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-81.25%
Maintainers
4
Weekly downloads
 
Created
Source

dynamic-tag

标签编辑器

可对多个标签进行编辑或新增删除,支持字符串数组或对象数组,拖动排序等。双击即可编辑已有标签,费编辑状态下拖动排序。

引入

yarn add dynamic-tag
npm i dynamic-tag

依赖项:element-ui

使用

<dynamic-tag v-model="tags" :type="['', 'danger']" @change="onChange" @close="onClose" />

import DynamicTag from 'dynamic-tag'
export default {
  components: { DynamicTag },
  data () {
    return {
      tags: ['asd', '和人', '但是公司的']
    }
  },
  methods: {
    onClose () {
      console.log('删除标签')
    },
    onChange () {
      console.log(this.tags)
      this.$forceUpdate()
    }
  }
}

参数

参数说明类型可选值默认值
maxlength每个标签最多字符数Number String--10
count标签最多个数Number String--8
type标签样式String Array'' 'danger' 'success' 'info' 'warning' 如果为数组,将会在多个颜色中循环使用''
addible是否可以新增Booleantrue falsetrue
editable是否可以编辑Booleantrue falsetrue
closable是否可以删除Booleantrue falsetrue
disabled是否禁用Booleantrue falsefalse
addName新增按钮名称String'''+ 新增标签'
objectKey对象键名,当绑定的值为对象数组时必填String''''
drag是否开启拖拽排序Booleantrue falsetrue



Methods

方法名| 参数 | 说明

  • | - | - close | - | 参数关闭时回调 change | - | 数据改变时回调

FAQs

Package last updated on 20 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc