Skip to content

Tag 标签 ​

基础用法 ​

vue
<template>
  <lh-tag>默认</lh-tag>
  <lh-tag type="primary">主要</lh-tag>
  <lh-tag type="success">成功</lh-tag>
  <lh-tag type="warning">警告</lh-tag>
  <lh-tag type="danger">危险</lh-tag>
</template>

样式与关闭 ​

vue
<template>
  <lh-tag round>圆角</lh-tag>
  <lh-tag hit>描边</lh-tag>
  <lh-tag closable @close="onClose">可关闭</lh-tag>
</template>

<script setup lang="ts">
const onClose = () => console.log('关闭了')
</script>

Props ​

属性说明类型默认值
type类型'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info''default'
size尺寸'small' | 'medium' | 'large'—
closable可关闭booleanfalse
disabled禁用booleanfalse
round圆角booleanfalse
hit描边(无填充)booleanfalse
customClass自定义类名string—
sx快速布局属性LhSxProps—

Events ​

事件说明回调参数
close点击关闭按钮—

与 Vue3 版的差异

关闭按钮里的内联 SVG 在本库换成 lh-icon(iconfont 方案)。