fix: fixed the icon defect which cause to langauge button can not be clicked (#8184)

This commit is contained in:
Harold Zhang
2026-07-23 12:20:38 +08:00
committed by GitHub
parent 28757fb9c8
commit f43de252b5

View File

@@ -12,7 +12,7 @@ import VbenButton from './button.vue';
interface Props extends VbenButtonProps {
class?: any;
disabled?: boolean;
onClick?: (() => void)[] | (() => void);
onClick?: ((e?: MouseEvent) => void)[] | ((e?: MouseEvent) => void);
tooltip?: string;
tooltipDelayDuration?: number;
tooltipSide?: 'bottom' | 'left' | 'right' | 'top';
@@ -31,13 +31,13 @@ const slots = useSlots();
const showTooltip = computed(() => !!slots.tooltip || !!props.tooltip);
function handleClick() {
function handleClick(e: MouseEvent) {
if (Array.isArray(props.onClick)) {
for (const fn of props.onClick) {
fn?.();
fn?.(e);
}
} else {
props.onClick?.();
props.onClick?.(e);
}
}
</script>