Commit e3851dc5ea290ef6eb4d12ce2469311b1bee53cd

Authored by vben
1 parent 4f8e1c1b

feat(moda;): can switch full screen by double-clicking on the head close #277

CHANGELOG.zh_CN.md
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 ### ✨ Features 3 ### ✨ Features
4 4
5 - 新增 `settingButtonPosition`配置项,用于配置`设置`按钮位置 5 - 新增 `settingButtonPosition`配置项,用于配置`设置`按钮位置
  6 +- `modal`可以通过双击头部切换全屏
6 7
7 ### ⚡ Performance Improvements 8 ### ⚡ Performance Improvements
8 9
src/components/Modal/src/BasicModal.vue
@@ -10,7 +10,11 @@ @@ -10,7 +10,11 @@
10 </template> 10 </template>
11 11
12 <template #title v-if="!$slots.title"> 12 <template #title v-if="!$slots.title">
13 - <ModalHeader :helpMessage="getProps.helpMessage" :title="getMergeProps.title" /> 13 + <ModalHeader
  14 + :helpMessage="getProps.helpMessage"
  15 + :title="getMergeProps.title"
  16 + @dblclick="handleTitleDbClick"
  17 + />
14 </template> 18 </template>
15 19
16 <template #footer v-if="!$slots.footer"> 20 <template #footer v-if="!$slots.footer">
@@ -193,6 +197,12 @@ @@ -193,6 +197,12 @@
193 extHeightRef.value = height; 197 extHeightRef.value = height;
194 } 198 }
195 199
  200 + function handleTitleDbClick(e: ChangeEvent) {
  201 + if (!props.canFullscreen) return;
  202 + e.stopPropagation();
  203 + handleFullScreen(e);
  204 + }
  205 +
196 return { 206 return {
197 handleCancel, 207 handleCancel,
198 getBindValue, 208 getBindValue,
@@ -206,6 +216,7 @@ @@ -206,6 +216,7 @@
206 modalWrapperRef, 216 modalWrapperRef,
207 handleExtHeight, 217 handleExtHeight,
208 handleHeightChange, 218 handleHeightChange,
  219 + handleTitleDbClick,
209 }; 220 };
210 }, 221 },
211 }); 222 });
src/design/index.less
@@ -44,6 +44,9 @@ body { @@ -44,6 +44,9 @@ body {
44 } 44 }
45 45
46 a:focus, 46 a:focus,
47 -a:active {  
48 - outline: none; 47 +a:active,
  48 +button,
  49 +div,
  50 +span {
  51 + outline: none !important;
49 } 52 }