Skip to content

Tag ​

Basic usage ​

vue
<template>
  <lh-tag>Default</lh-tag>
  <lh-tag type="primary">Primary</lh-tag>
  <lh-tag type="success">Success</lh-tag>
  <lh-tag type="warning">Warning</lh-tag>
  <lh-tag type="danger">Danger</lh-tag>
</template>

Style and closing ​

vue
<template>
  <lh-tag round>Rounded</lh-tag>
  <lh-tag hit>Outlined</lh-tag>
  <lh-tag closable @close="onClose">Closable</lh-tag>
</template>

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

Props ​

PropDescriptionTypeDefault
typeType'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info''default'
sizeSize'small' | 'medium' | 'large'—
closableClosablebooleanfalse
disabledDisabledbooleanfalse
roundRounded cornersbooleanfalse
hitOutlined (no fill)booleanfalse
customClassCustom class namestring—
sxQuick layout propsLhSxProps—

Events ​

EventDescriptionCallback parameters
closeThe close button was tapped—

Differences from the Vue3 version

The inline SVG inside the close button is replaced by lh-icon (the iconfont approach) in this library.