Commit 88de82c493b068b6d9bb5e29475350ed092fe482

Authored by vben
1 parent c0e4c9e5

fix: fix drawer autoHeight

CHANGELOG.zh_CN.md
  1 +## Wip
  2 +
  3 +### 🐛 Bug Fixes
  4 +
  5 +- 修复抽屉组件自动高度及显示 footer 显示问题
  6 +
1 7 # 2.0.0-rc.4 (2020-10-21)
2 8  
3 9 ### ✨ Features
... ... @@ -24,6 +30,7 @@
24 30 - 修复预览命令不打包问题
25 31 - 修复表格 actionColOptions 参数不生效问题
26 32 - 修复表格刷新表单 loading 不生效问题
  33 +- 修复带参界面刷新参数丢失问题
27 34  
28 35 # 2.0.0-rc.3 (2020-10-19)
29 36  
... ...
src/components/Drawer/src/BasicDrawer.tsx
... ... @@ -109,7 +109,7 @@ export default defineComponent({
109 109 if (showFooter && footerHeight) {
110 110 return isNumber(footerHeight) ? `${footerHeight}px` : `${footerHeight.replace('px', '')}px`;
111 111 }
112   - return 0;
  112 + return `0px`;
113 113 });
114 114 function renderFooter() {
115 115 const {
... ... @@ -195,7 +195,6 @@ export default defineComponent({
195 195  
196 196 return () => {
197 197 const footerHeight = unref(getFooterHeight);
198   -
199 198 return (
200 199 <Drawer
201 200 class={prefixCls}
... ... @@ -217,8 +216,9 @@ export default defineComponent({
217 216 <div
218 217 ref={scrollRef}
219 218 {...attrs}
  219 + data-id="123"
220 220 style={{
221   - height: `calc(100% - ${footerHeight}px)`,
  221 + height: `calc(100% - ${footerHeight})`,
222 222 overflow: 'auto',
223 223 padding: '16px',
224 224 paddingBottom: '30px',
... ...
src/components/Drawer/src/index.less
... ... @@ -53,6 +53,9 @@
53 53 }
54 54  
55 55 &__footer {
  56 + position: absolute;
  57 + bottom: 0;
  58 + width: 100%;
56 59 height: @footer-height;
57 60 padding: 0 26px;
58 61 line-height: @footer-height;
... ...
src/layouts/Logo.vue
1 1 <template>
2 2 <div class="app-logo" @click="handleGoHome">
3 3 <img :src="logo" />
4   - <div v-if="show" class="logo-title ml-1 ellipsis">{{ globSetting.title }}</div>
  4 + <div v-if="show" class="logo-title ml-1 mt-1 ellipsis">{{ globSetting.title }}</div>
5 5 </div>
6 6 </template>
7 7 <script lang="ts">
... ... @@ -55,7 +55,7 @@
55 55  
56 56 .app-logo {
57 57 display: flex;
58   - justify-content: center;
  58 + // justify-content: center;
59 59 align-items: center;
60 60 cursor: pointer;
61 61  
... ...
src/utils/http/axios/Axios.ts
... ... @@ -6,7 +6,7 @@ import { isFunction } from &#39;/@/utils/is&#39;;
6 6 import { cloneDeep } from 'lodash-es';
7 7  
8 8 import type { RequestOptions, CreateAxiosOptions, Result } from './types';
9   -import { ContentTypeEnum } from '/@/enums/httpEnum';
  9 +// import { ContentTypeEnum } from '/@/enums/httpEnum';
10 10 import { errorResult } from './const';
11 11  
12 12 export * from './axiosTransform';
... ... @@ -107,25 +107,25 @@ export class VAxios {
107 107 this.axiosInstance.interceptors.response.use(undefined, responseInterceptorsCatch);
108 108 }
109 109  
110   - /**
111   - * @description: 文件上传
112   - */
113   - uploadFiles(config: AxiosRequestConfig, params: File[]) {
114   - const formData = new FormData();
115   -
116   - Object.keys(params).forEach((key) => {
117   - formData.append(key, params[key as any]);
118   - });
119   -
120   - return this.request({
121   - ...config,
122   - method: 'POST',
123   - data: formData,
124   - headers: {
125   - 'Content-type': ContentTypeEnum.FORM_DATA,
126   - },
127   - });
128   - }
  110 + // /**
  111 + // * @description: 文件上传
  112 + // */
  113 + // uploadFiles(config: AxiosRequestConfig, params: File[]) {
  114 + // const formData = new FormData();
  115 +
  116 + // Object.keys(params).forEach((key) => {
  117 + // formData.append(key, params[key as any]);
  118 + // });
  119 +
  120 + // return this.request({
  121 + // ...config,
  122 + // method: 'POST',
  123 + // data: formData,
  124 + // headers: {
  125 + // 'Content-type': ContentTypeEnum.FORM_DATA,
  126 + // },
  127 + // });
  128 + // }
129 129  
130 130 /**
131 131 * @description: 请求方法
... ...
src/views/demo/comp/drawer/Drawer3.vue
1 1 <template>
2 2 <BasicDrawer v-bind="$attrs" title="Modal Title" width="50%" showFooter>
3   - <p class="h-20" v-for="index in 20" :key="index">根据屏幕高度自适应</p>
  3 + <p class="h-20" v-for="index in 40" :key="index">根据屏幕高度自适应</p>
4 4 </BasicDrawer>
5 5 </template>
6 6 <script lang="ts">
... ...