Fix: 在isMobile=true时无法自定义Drawer的class问题 (#7941)
* fix: 在isMobile=true时无法自定义Drawer的class问题 * fix: 在ResizableHandle两边增加边距pull/348/MERGE
parent
6b81d1b0d5
commit
c066889c37
|
|
@ -54,7 +54,6 @@ const components = globalShareState.getComponents();
|
||||||
const id = useId();
|
const id = useId();
|
||||||
provide('DISMISSABLE_DRAWER_ID', id);
|
provide('DISMISSABLE_DRAWER_ID', id);
|
||||||
|
|
||||||
// @ts-expect-error unused
|
|
||||||
const wrapperRef = ref<HTMLElement>();
|
const wrapperRef = ref<HTMLElement>();
|
||||||
const { $t } = useSimpleLocale();
|
const { $t } = useSimpleLocale();
|
||||||
const { isMobile } = useIsMobile();
|
const { isMobile } = useIsMobile();
|
||||||
|
|
@ -185,11 +184,16 @@ const getForceMount = computed(() => {
|
||||||
<SheetContent
|
<SheetContent
|
||||||
:append-to="getAppendTo"
|
:append-to="getAppendTo"
|
||||||
:class="
|
:class="
|
||||||
cn('flex w-130 flex-col', drawerClass, {
|
cn(
|
||||||
'w-full!': isMobile || placement === 'bottom' || placement === 'top',
|
'flex w-130 flex-col',
|
||||||
'max-h-screen': placement === 'bottom' || placement === 'top',
|
{
|
||||||
hidden: isClosed,
|
'w-full!':
|
||||||
})
|
isMobile || placement === 'bottom' || placement === 'top',
|
||||||
|
'max-h-screen': placement === 'bottom' || placement === 'top',
|
||||||
|
hidden: isClosed,
|
||||||
|
},
|
||||||
|
drawerClass,
|
||||||
|
)
|
||||||
"
|
"
|
||||||
:modal="modal"
|
:modal="modal"
|
||||||
:open="state?.isOpen"
|
:open="state?.isOpen"
|
||||||
|
|
|
||||||
|
|
@ -76,14 +76,16 @@ defineExpose({
|
||||||
:min-size="leftMinWidth"
|
:min-size="leftMinWidth"
|
||||||
>
|
>
|
||||||
<template #default="slotProps">
|
<template #default="slotProps">
|
||||||
<slot
|
<div class="h-full pr-2">
|
||||||
name="left"
|
<slot
|
||||||
v-bind="{
|
name="left"
|
||||||
...slotProps,
|
v-bind="{
|
||||||
expand: expandLeft,
|
...slotProps,
|
||||||
collapse: collapseLeft,
|
expand: expandLeft,
|
||||||
}"
|
collapse: collapseLeft,
|
||||||
></slot>
|
}"
|
||||||
|
></slot>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</ResizablePanel>
|
</ResizablePanel>
|
||||||
<ResizableHandle
|
<ResizableHandle
|
||||||
|
|
@ -99,7 +101,9 @@ defineExpose({
|
||||||
:min-size="rightMinWidth"
|
:min-size="rightMinWidth"
|
||||||
>
|
>
|
||||||
<template #default>
|
<template #default>
|
||||||
<slot></slot>
|
<div class="h-full pl-2">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</ResizablePanel>
|
</ResizablePanel>
|
||||||
</ResizablePanelGroup>
|
</ResizablePanelGroup>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue