Skip to content

Commit

Permalink
fix: fix drawer autoHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Oct 22, 2020
1 parent c0e4c9e commit 88de82c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 26 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Wip

### 🐛 Bug Fixes

- 修复抽屉组件自动高度及显示 footer 显示问题

# 2.0.0-rc.4 (2020-10-21)

### ✨ Features
Expand All @@ -24,6 +30,7 @@
- 修复预览命令不打包问题
- 修复表格 actionColOptions 参数不生效问题
- 修复表格刷新表单 loading 不生效问题
- 修复带参界面刷新参数丢失问题

# 2.0.0-rc.3 (2020-10-19)

Expand Down
6 changes: 3 additions & 3 deletions src/components/Drawer/src/BasicDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default defineComponent({
if (showFooter && footerHeight) {
return isNumber(footerHeight) ? `${footerHeight}px` : `${footerHeight.replace('px', '')}px`;
}
return 0;
return `0px`;
});
function renderFooter() {
const {
Expand Down Expand Up @@ -195,7 +195,6 @@ export default defineComponent({

return () => {
const footerHeight = unref(getFooterHeight);

return (
<Drawer
class={prefixCls}
Expand All @@ -217,8 +216,9 @@ export default defineComponent({
<div
ref={scrollRef}
{...attrs}
data-id="123"
style={{
height: `calc(100% - ${footerHeight}px)`,
height: `calc(100% - ${footerHeight})`,
overflow: 'auto',
padding: '16px',
paddingBottom: '30px',
Expand Down
3 changes: 3 additions & 0 deletions src/components/Drawer/src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
}

&__footer {
position: absolute;
bottom: 0;
width: 100%;
height: @footer-height;
padding: 0 26px;
line-height: @footer-height;
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/Logo.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="app-logo" @click="handleGoHome">
<img :src="logo" />
<div v-if="show" class="logo-title ml-1 ellipsis">{{ globSetting.title }}</div>
<div v-if="show" class="logo-title ml-1 mt-1 ellipsis">{{ globSetting.title }}</div>
</div>
</template>
<script lang="ts">
Expand Down Expand Up @@ -55,7 +55,7 @@
.app-logo {
display: flex;
justify-content: center;
// justify-content: center;
align-items: center;
cursor: pointer;
Expand Down
40 changes: 20 additions & 20 deletions src/utils/http/axios/Axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { isFunction } from '/@/utils/is';
import { cloneDeep } from 'lodash-es';

import type { RequestOptions, CreateAxiosOptions, Result } from './types';
import { ContentTypeEnum } from '/@/enums/httpEnum';
// import { ContentTypeEnum } from '/@/enums/httpEnum';
import { errorResult } from './const';

export * from './axiosTransform';
Expand Down Expand Up @@ -107,25 +107,25 @@ export class VAxios {
this.axiosInstance.interceptors.response.use(undefined, responseInterceptorsCatch);
}

/**
* @description: 文件上传
*/
uploadFiles(config: AxiosRequestConfig, params: File[]) {
const formData = new FormData();

Object.keys(params).forEach((key) => {
formData.append(key, params[key as any]);
});

return this.request({
...config,
method: 'POST',
data: formData,
headers: {
'Content-type': ContentTypeEnum.FORM_DATA,
},
});
}
// /**
// * @description: 文件上传
// */
// uploadFiles(config: AxiosRequestConfig, params: File[]) {
// const formData = new FormData();

// Object.keys(params).forEach((key) => {
// formData.append(key, params[key as any]);
// });

// return this.request({
// ...config,
// method: 'POST',
// data: formData,
// headers: {
// 'Content-type': ContentTypeEnum.FORM_DATA,
// },
// });
// }

/**
* @description: 请求方法
Expand Down
2 changes: 1 addition & 1 deletion src/views/demo/comp/drawer/Drawer3.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<BasicDrawer v-bind="$attrs" title="Modal Title" width="50%" showFooter>
<p class="h-20" v-for="index in 20" :key="index">根据屏幕高度自适应</p>
<p class="h-20" v-for="index in 40" :key="index">根据屏幕高度自适应</p>
</BasicDrawer>
</template>
<script lang="ts">
Expand Down

0 comments on commit 88de82c

Please sign in to comment.