Skip to content

Conversation

yaroslav8765
Copy link
Contributor

No description provided.

beforeOpenFunction: {
type: Function,
default: null,
},
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets rewrite to typescript style-props

<script setup lang="ts">
type DialogLike = { hide: () => void }

export interface Button {
  label: string
  onclick?: (dialog: DialogLike) => void
  type?: string
}

const props = withDefaults(defineProps<{
  header?: string
  headerCloseButton?: boolean
  buttons?: Button[]
  clickToCloseOutside?: boolean
  beforeCloseFunction?: (() => void) | null
  beforeOpenFunction?: (() => void) | null
}>(), {
  header: '',
  headerCloseButton: true,
  buttons: () => [{ label: 'Close', onclick: (d: DialogLike) => d.hide(), type: '' }],
  clickToCloseOutside: true,
  beforeCloseFunction: null,
  beforeOpenFunction: null,
})
</script>

@ivictbor ivictbor merged commit e6bc3dc into next Sep 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants