mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-27 10:20:42 +01:00
fix(Modal/Popover/Slideover)!: rename prevent-close to dismissible + uniformize docs
This commit is contained in:
@@ -46,10 +46,10 @@ export interface SlideoverProps extends DialogRootProps {
|
||||
*/
|
||||
closeIcon?: string
|
||||
/**
|
||||
* When `true`, the slideover will not close when clicking outside.
|
||||
* @defaultValue false
|
||||
* When `false`, the slideover will not close when clicking outside or pressing escape.
|
||||
* @defaultValue true
|
||||
*/
|
||||
preventClose?: boolean
|
||||
dismissible?: boolean
|
||||
class?: any
|
||||
ui?: Partial<typeof slideover.slots>
|
||||
}
|
||||
@@ -84,6 +84,7 @@ const props = withDefaults(defineProps<SlideoverProps>(), {
|
||||
overlay: true,
|
||||
transition: true,
|
||||
modal: true,
|
||||
dismissible: true,
|
||||
side: 'right'
|
||||
})
|
||||
const emits = defineEmits<SlideoverEmits>()
|
||||
@@ -95,7 +96,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