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 # 2.0.0-rc.4 (2020-10-21) 7 # 2.0.0-rc.4 (2020-10-21)
2 8
3 ### ✨ Features 9 ### ✨ Features
@@ -24,6 +30,7 @@ @@ -24,6 +30,7 @@
24 - 修复预览命令不打包问题 30 - 修复预览命令不打包问题
25 - 修复表格 actionColOptions 参数不生效问题 31 - 修复表格 actionColOptions 参数不生效问题
26 - 修复表格刷新表单 loading 不生效问题 32 - 修复表格刷新表单 loading 不生效问题
  33 +- 修复带参界面刷新参数丢失问题
27 34
28 # 2.0.0-rc.3 (2020-10-19) 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,7 +109,7 @@ export default defineComponent({
109 if (showFooter && footerHeight) { 109 if (showFooter && footerHeight) {
110 return isNumber(footerHeight) ? `${footerHeight}px` : `${footerHeight.replace('px', '')}px`; 110 return isNumber(footerHeight) ? `${footerHeight}px` : `${footerHeight.replace('px', '')}px`;
111 } 111 }
112 - return 0; 112 + return `0px`;
113 }); 113 });
114 function renderFooter() { 114 function renderFooter() {
115 const { 115 const {
@@ -195,7 +195,6 @@ export default defineComponent({ @@ -195,7 +195,6 @@ export default defineComponent({
195 195
196 return () => { 196 return () => {
197 const footerHeight = unref(getFooterHeight); 197 const footerHeight = unref(getFooterHeight);
198 -  
199 return ( 198 return (
200 <Drawer 199 <Drawer
201 class={prefixCls} 200 class={prefixCls}
@@ -217,8 +216,9 @@ export default defineComponent({ @@ -217,8 +216,9 @@ export default defineComponent({
217 <div 216 <div
218 ref={scrollRef} 217 ref={scrollRef}
219 {...attrs} 218 {...attrs}
  219 + data-id="123"
220 style={{ 220 style={{
221 - height: `calc(100% - ${footerHeight}px)`, 221 + height: `calc(100% - ${footerHeight})`,
222 overflow: 'auto', 222 overflow: 'auto',
223 padding: '16px', 223 padding: '16px',
224 paddingBottom: '30px', 224 paddingBottom: '30px',
src/components/Drawer/src/index.less
@@ -53,6 +53,9 @@ @@ -53,6 +53,9 @@
53 } 53 }
54 54
55 &__footer { 55 &__footer {
  56 + position: absolute;
  57 + bottom: 0;
  58 + width: 100%;
56 height: @footer-height; 59 height: @footer-height;
57 padding: 0 26px; 60 padding: 0 26px;
58 line-height: @footer-height; 61 line-height: @footer-height;
src/layouts/Logo.vue
1 <template> 1 <template>
2 <div class="app-logo" @click="handleGoHome"> 2 <div class="app-logo" @click="handleGoHome">
3 <img :src="logo" /> 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 </div> 5 </div>
6 </template> 6 </template>
7 <script lang="ts"> 7 <script lang="ts">
@@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
55 55
56 .app-logo { 56 .app-logo {
57 display: flex; 57 display: flex;
58 - justify-content: center; 58 + // justify-content: center;
59 align-items: center; 59 align-items: center;
60 cursor: pointer; 60 cursor: pointer;
61 61
src/utils/http/axios/Axios.ts
@@ -6,7 +6,7 @@ import { isFunction } from &#39;/@/utils/is&#39;; @@ -6,7 +6,7 @@ import { isFunction } from &#39;/@/utils/is&#39;;
6 import { cloneDeep } from 'lodash-es'; 6 import { cloneDeep } from 'lodash-es';
7 7
8 import type { RequestOptions, CreateAxiosOptions, Result } from './types'; 8 import type { RequestOptions, CreateAxiosOptions, Result } from './types';
9 -import { ContentTypeEnum } from '/@/enums/httpEnum'; 9 +// import { ContentTypeEnum } from '/@/enums/httpEnum';
10 import { errorResult } from './const'; 10 import { errorResult } from './const';
11 11
12 export * from './axiosTransform'; 12 export * from './axiosTransform';
@@ -107,25 +107,25 @@ export class VAxios { @@ -107,25 +107,25 @@ export class VAxios {
107 this.axiosInstance.interceptors.response.use(undefined, responseInterceptorsCatch); 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 * @description: 请求方法 131 * @description: 请求方法
src/views/demo/comp/drawer/Drawer3.vue
1 <template> 1 <template>
2 <BasicDrawer v-bind="$attrs" title="Modal Title" width="50%" showFooter> 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 </BasicDrawer> 4 </BasicDrawer>
5 </template> 5 </template>
6 <script lang="ts"> 6 <script lang="ts">