Commit e3851dc5ea290ef6eb4d12ce2469311b1bee53cd
1 parent
4f8e1c1b
feat(moda;): can switch full screen by double-clicking on the head close #277
Showing
3 changed files
with
18 additions
and
3 deletions
CHANGELOG.zh_CN.md
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 | }); |