Skip to content

图标按钮组件 ​

基于 naive-ui 的二次封装图标按钮组件。

INFO

无需引入,可直接使用

Usage ​

vue
<template>
  <WCompUIIconButton
    :icon-props="{ icon: 'ep:search' }"
    :button-props="{ type: 'primary' }"
    :tooltip="true"
    tooltip-msg="搜索"
    :confirm="true"
    confirm-msg="确定要搜索吗?"
    @confirm="onConfirm"
  />
</template>

Props ​

名称类型默认值说明
iconPropsICompUIIconProps-图标属性
buttonPropsICompUIButtonProps-按钮属性
tooltipbooleanfalse是否显示提示框
tooltipMsgstring | string[]-提示框消息
tooltipPropsTooltipProps-提示框属性
confirmbooleanfalse是否显示确认框
confirmMsgstring'app.base.confirm'确认框消息
popConfirmPropsPopconfirmProps-确认框属性

Type ​

ts
import type { PopconfirmProps, TooltipProps } from 'naive-ui'
import type { AllowedComponentProps } from 'vue'
import type { ICompUIButtonProps } from '../Button'
import type { ICompUIIconProps } from '../Icon'

export interface ICompUIIconButtonProps extends AllowedComponentProps {
  iconProps?: ICompUIIconProps
  buttonProps?: ICompUIButtonProps
  tooltip?: boolean
  tooltipMsg?: string | string[]
  tooltipProps?: TooltipProps
  confirm?: boolean
  confirmMsg?: string
  popConfirmProps?: PopconfirmProps
}

基于 MIT 许可发布