Skip to content

Commit

Permalink
feat(moda;): can switch full screen by double-clicking on the head close
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Feb 19, 2021
1 parent 4f8e1c1 commit e3851dc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### ✨ Features

- 新增 `settingButtonPosition`配置项,用于配置`设置`按钮位置
- `modal`可以通过双击头部切换全屏

### ⚡ Performance Improvements

Expand Down
13 changes: 12 additions & 1 deletion src/components/Modal/src/BasicModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
</template>

<template #title v-if="!$slots.title">
<ModalHeader :helpMessage="getProps.helpMessage" :title="getMergeProps.title" />
<ModalHeader
:helpMessage="getProps.helpMessage"
:title="getMergeProps.title"
@dblclick="handleTitleDbClick"
/>
</template>

<template #footer v-if="!$slots.footer">
Expand Down Expand Up @@ -193,6 +197,12 @@
extHeightRef.value = height;
}
function handleTitleDbClick(e: ChangeEvent) {
if (!props.canFullscreen) return;
e.stopPropagation();
handleFullScreen(e);
}
return {
handleCancel,
getBindValue,
Expand All @@ -206,6 +216,7 @@
modalWrapperRef,
handleExtHeight,
handleHeightChange,
handleTitleDbClick,
};
},
});
Expand Down
7 changes: 5 additions & 2 deletions src/design/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ body {
}

a:focus,
a:active {
outline: none;
a:active,
button,
div,
span {
outline: none !important;
}

0 comments on commit e3851dc

Please sign in to comment.