开始使用
COMPONENTSIconButton

IconButton 图标按钮 ​

WIconButton 是 Button 的别名,不增加默认尺寸、图标库或无障碍属性。

本期保持 PrimeVue 4.5.5 原生 API。使用前按快速开始安装插件与 CSS。

交互示例 ​

PREVIEW

使用代码 ​

vue
<script setup lang="ts">
import { Add1Icon } from '@wizdomt/icons'
import { ref } from 'vue'
import { WIconButton } from '@wizdomt/ui'
const count = ref(0)
</script>

<template>
  <WIconButton aria-label="添加" rounded outlined @click="count++">
    <template #icon><Add1Icon :size="18" /></template>
  </WIconButton>
  <span role="status">点击 {{ count }} 次</span>
</template>

常用 Props / 配置 ​

名称说明类型默认值
aria-label无可见文字时必填string—
rounded圆形外观booleanfalse

事件与方法 ​

click:原生 MouseEvent。

插槽 ​

default、icon、loadingicon;业务 SVG 通过 icon 传入。

响应式与无障碍 ​

组件保持原生行为,不自动切换交互。为交互元素提供 label 或 aria-label;浮层按容器设置 max-width。响应式指南说明设备验证方法。

完整 Props、事件、Slots、Methods 以上游锁定版本类型声明为准。PrimeVue v4 button 文档可能包含较新 4.x API,使用时以本包 TypeScript 提示为准。

Wizdomt UI Vue 3 · PrimeVue 4