Skip to content

Commit 234be39

Browse files
authored
fix(editor-md): tooltip position when fullscreen (DevCloudFE#1727)
1 parent a1cc3db commit 234be39

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

packages/devui-vue/devui/editor-md/src/components/toolbar-item.tsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,18 @@ export default defineComponent({
3030
const editorIns = getEditorIns();
3131
if (config.id === 'fullscreen') {
3232
showFullscreen.value = !showFullscreen.value;
33-
} else {
34-
config.handler?.(editorIns, config.params);
33+
if (window) {
34+
const event = new Event('resize');
35+
window.dispatchEvent(event);
36+
}
3537
}
38+
config.handler?.(editorIns, config.params);
3639
};
3740

3841
return () => (
3942
<>
4043
{config.type === 'button' && (
41-
<Tooltip position={['top', 'bottom']} content={getTooltipContent(config.name, config.shortKey)}>
44+
<Tooltip position={['top', 'bottom']} content={getTooltipContent(config.name, config.shortKey)} hide-after={1000}>
4245
<span
4346
class="md-toolbar-item"
4447
onClick={onToolbarItemClick}
@@ -50,7 +53,7 @@ export default defineComponent({
5053
{{
5154
default: () => (
5255
<span>
53-
<Tooltip position={['top']} content={getTooltipContent(config.name)}>
56+
<Tooltip position={showFullscreen.value ? ['right'] : ['top']} content={getTooltipContent(config.name)} hide-after={1000}>
5457
<span class="md-toolbar-item" onClick={() => config.handler?.()} innerHTML={config.icon}></span>
5558
</Tooltip>
5659
</span>

packages/devui-vue/devui/fullscreen/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export { Fullscreen };
77

88
export default {
99
title: 'Fullscreen 全屏',
10-
category: '基础组件',
10+
category: '通用',
1111
install(app: App): void {
1212
app.component(Fullscreen.name, Fullscreen);
1313
},

packages/devui-vue/docs/components/editor-md/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ editor-md/checkbox
242242
v-model="content"
243243
:placeholder="'You can enter @ associate member, enter # to associate an order number...'"
244244
:hint-config="hintConfig"
245+
fullscreen-z-index="1000"
245246
@content-change="valueChange"
246247
>
247248
<template #hintTemplate>

0 commit comments

Comments
 (0)