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 | 10 | </template> |
11 | 11 | |
12 | 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 | 18 | </template> |
15 | 19 | |
16 | 20 | <template #footer v-if="!$slots.footer"> |
... | ... | @@ -193,6 +197,12 @@ |
193 | 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 | 206 | return { |
197 | 207 | handleCancel, |
198 | 208 | getBindValue, |
... | ... | @@ -206,6 +216,7 @@ |
206 | 216 | modalWrapperRef, |
207 | 217 | handleExtHeight, |
208 | 218 | handleHeightChange, |
219 | + handleTitleDbClick, | |
209 | 220 | }; |
210 | 221 | }, |
211 | 222 | }); | ... | ... |