Skip to content

Commit

Permalink
feat: 优化Drawer滚动 & 优化VirtualList参数配置
Browse files Browse the repository at this point in the history
  • Loading branch information
wanchun committed Jun 18, 2023
1 parent 08273d0 commit c507a49
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
10 changes: 7 additions & 3 deletions components/drawer/drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
} from 'vue';
import { isNumber } from 'lodash-es';
import getPrefixCls from '../_util/getPrefixCls';
import FButton from '../button/button';
import FButton from '../button';
import FScrollbar from '../scrollbar';
import { CloseOutlined } from '../icon';
import PopupManager from '../_util/popupManager';
import useLockScreen from '../_util/use/useLockScreen';
Expand Down Expand Up @@ -215,9 +216,12 @@ const Drawer = defineComponent({
onClick={(event) => event.stopPropagation()}
>
{getHeader()}
<div class={`${prefixCls}-body`}>
<FScrollbar
class={`${prefixCls}-body-wrapper`}
containerClass={`${prefixCls}-body-container`}
>
{ctx.slots.default?.()}
</div>
</FScrollbar>
{getFooter()}
</div>
</div>
Expand Down
15 changes: 9 additions & 6 deletions components/drawer/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
.fixed-full();
display: flex;
}

&-wrapper {
position: relative;
display: flex;
Expand All @@ -30,7 +30,7 @@
border-radius: var(--f-border-radius-base);
box-shadow: @shadow-down;
}

&-header {
position: relative;
display: flex;
Expand All @@ -47,10 +47,13 @@
}
}

&-body {
&-body-wrapper {
flex: 1;
}

&-body-container {
box-sizing: border-box;
padding: @padding-md calc(@padding-md + @padding-xs);
overflow: auto;
color: var(--f-sub-head-color);
font-size: var(--f-font-size-base);
}
Expand Down Expand Up @@ -78,7 +81,7 @@
&-mask-fade-enter-active {
transition: opacity @animation-duration-slow @ease-base-in;
}

&-mask-fade-leave-to,
&-mask-fade-enter-from {
opacity: 0;
Expand Down Expand Up @@ -155,4 +158,4 @@
}
}

}
}
1 change: 1 addition & 0 deletions components/virtual-list/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const virtualProps = {
dataSources: {
type: Array as PropType<DataSource[]>,
required: true,
default: (): DataSource[] => [],
},
keeps: {
type: Number,
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/components/drawer/common.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
:footer="true"
@ok="show[4] = false"
>
<div>我是内容...</div>
<div style="height: 1000px">我是内容...</div>
<div>我是内容...</div>
<div>我是内容...</div>
</FDrawer>
Expand Down

0 comments on commit c507a49

Please sign in to comment.