Skip to content

Commit c8b70a4

Browse files
committed
feat(alert-dialog): add showIcon prop to control icon visibility in AlertDialog component
1 parent f295be2 commit c8b70a4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/alert-dialog/alert-dialog.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ defineOptions({
2424
2525
const props = withDefaults(defineProps<AlertDialogProps>(), {
2626
open: undefined,
27-
defaultOpen: false
27+
defaultOpen: false,
28+
showIcon: true
2829
});
2930
3031
const forwardedProps = useOmitProps(props, [
@@ -99,7 +100,7 @@ provideSizeContext(() => props.size);
99100
<AlertDialogContent v-bind="contentProps" v-on="listeners">
100101
<AlertDialogHeader v-bind="headerProps">
101102
<AlertDialogTitle v-bind="titleProps">
102-
<Icon v-if="iconConfig" :icon="iconConfig.icon" :class="iconConfig.class" />
103+
<Icon v-if="showIcon && iconConfig" :icon="iconConfig.icon" :class="iconConfig.class" />
103104
<slot name="title" v-bind="slotProps">{{ title }}</slot>
104105
</AlertDialogTitle>
105106
<AlertDialogDescription v-if="slots.description || description" v-bind="descriptionProps">

src/components/alert-dialog/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export type AlertDialogType = Extract<ThemeColor, 'destructive' | 'success' | 'w
77

88
export interface AlertDialogProps extends Omit<DialogProps, 'modal' | 'closable'> {
99
type?: AlertDialogType;
10+
showIcon?: boolean;
1011
}
1112

1213
export type AlertDialogEmits = AlertDialogRootEmits;

0 commit comments

Comments
 (0)