mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-21 07:21:46 +01:00
fix(Modal/Popover/Slideover)!: rename prevent-close to dismissible + uniformize docs
This commit is contained in:
@@ -48,10 +48,10 @@ export interface ModalProps extends DialogRootProps {
|
||||
*/
|
||||
closeIcon?: string
|
||||
/**
|
||||
* When `true`, the modal will not close when clicking outside.
|
||||
* @defaultValue false
|
||||
* When `false`, the modal will not close when clicking outside or pressing escape.
|
||||
* @defaultValue true
|
||||
*/
|
||||
preventClose?: boolean
|
||||
dismissible?: boolean
|
||||
class?: any
|
||||
ui?: Partial<typeof modal.slots>
|
||||
}
|
||||
@@ -85,7 +85,8 @@ const props = withDefaults(defineProps<ModalProps>(), {
|
||||
portal: true,
|
||||
overlay: true,
|
||||
transition: true,
|
||||
modal: true
|
||||
modal: true,
|
||||
dismissible: true
|
||||
})
|
||||
const emits = defineEmits<ModalEmits>()
|
||||
const slots = defineSlots<ModalSlots>()
|
||||
@@ -96,7 +97,7 @@ const appConfig = useAppConfig()
|
||||
const rootProps = useForwardPropsEmits(reactivePick(props, 'open', 'defaultOpen', 'modal'), emits)
|
||||
const contentProps = toRef(() => props.content)
|
||||
const contentEvents = computed(() => {
|
||||
if (props.preventClose) {
|
||||
if (!props.dismissible) {
|
||||
return {
|
||||
pointerDownOutside: (e: Event) => e.preventDefault(),
|
||||
interactOutside: (e: Event) => e.preventDefault(),
|
||||
|
||||
Reference in New Issue
Block a user