Skip to content

功能

基于 el-tag,用于标签组的编辑,可以拖拽排序

TIP

此组件依赖 vuedraggable-es,使用时需要

npm i vuedraggable-es@^4.1.1

功能示例

展示区
小龙虾毛血旺剁椒鱼头冰激凌
结果
[ "小龙虾", "毛血旺", "剁椒鱼头", "冰激凌" ]
展示区:只能是数字
111222333444
结果
[ 111, 222, 333, 444 ]
只读展示
小龙虾
毛血旺
剁椒鱼头
冰激凌

最小示例

vue
<template>
    <Wrapper>
        <HTags v-model="result" />
    </Wrapper>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import Wrapper from '@/components/simple-wrapper.vue'
import HTags from '../index.vue'

const result = ref<string[]>(['小龙虾', '毛血旺', '剁椒鱼头', '冰激凌'])
</script>

API