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 方案)。