0.0.16 • Published 7 months ago

@moment-design/choose-tag v0.0.16

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

选择标签组件

使用组件

安装依赖

npm install @moment-design/choose-tag --save

使用组件

<template>
  <m-button type="primary" @click="refChooseTag.open()"> 选择标签 </m-button>
  <div style="margin-top: 16px">已选数据:{{ config.data }}</div>
  <!-- 选择标签组件 -->
  <ChooseTag
    ref="refChooseTag"
    :config="config"
    @change="(v: any) => (v?.length && (config.data = v))"
  ></ChooseTag>
</template>

<script setup lang="ts">
import { reactive, ref } from 'vue';
import ChooseTag from '../index.vue';

const refChooseTag = ref();
const config: any = reactive({
  add: true,
  max: 3,
  tags: [
    { label: '社群标签', value: 2 },
    { label: '自动标签', value: 5 },
    { label: '企微标签', value: 6 },
  ],
  apis: {
    // 数结构接口
    // querylabelType,
    // 点击树获取详情接口
    // queryLabelList,
    // 左侧搜索功能接口
    // queryTreeLabelInfo,
    // 新增标签接口
    // addLabel,
  },
  data: [],
});
</script>

API

Props

参数名描述类型默认值
add是否可添加标签booleanfalse
max最大可选数量number-
tags顶部一级标签显示配置any{label: string, value: string,number}[]
apis数据接口apisConfig{}

apisConfig

参数名描述类型默认值
querylabelType数结构接口any-
queryLabelList点击树获取详情接口any-
queryTreeLabelInfo左侧搜索功能接口any-
addLabel新增标签接口any-

Events

事件名描述参数
change已选数据(datas: any[])

Expose

事件名描述参数
open主动触发打开弹窗datas
0.0.16

7 months ago

0.0.15

9 months ago

0.0.14

9 months ago

0.0.13

9 months ago

0.0.12

9 months ago

0.0.11

9 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.1

11 months ago