Skip to content

Commit

Permalink
fix: 编辑器中国际化词条配置弹窗切换全屏时位置问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yy-wow committed Dec 27, 2024
1 parent 9027902 commit dc3f7f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/common/component/MonacoEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
:options="editorOptions"
language="javascript"
@editorDidMount="$emit('editorDidMount', $event)"
@change="$emit('change', $event)"
@shortcutSave="$emit('shortcutSave', $event)"
></monaco-editor>
</div>
<slot v-if="fullscreen" name="fullscreenFooter"></slot>
Expand Down Expand Up @@ -60,8 +62,8 @@ export default {
default: true
}
},
emits: ['editorDidMount'],
setup(props) {
emits: ['editorDidMount', 'change', 'shortcutSave', 'fullscreenChange'],
setup(props, { emit }) {
const editor = ref(null)
const fullscreen = ref(false)
const editorOptions = computed(() => {
Expand Down Expand Up @@ -112,6 +114,7 @@ export default {
const switchFullScreen = (value) => {
fullscreen.value = value
emit('fullscreenChange', value)
}
return {
Expand Down
6 changes: 6 additions & 0 deletions packages/plugins/state/src/CreateVariable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
:showFormatBtn="true"
:options="state.editorOptions"
@editorDidMount="editorDidMount"
@fullscreenChange="fullscreenChange"
>
<template #buttons>
<editor-i18n-tool ref="i18nToolRef" @confirm="insertContent"></editor-i18n-tool>
Expand Down Expand Up @@ -340,6 +341,10 @@ export default {
}
}
const fullscreenChange = () => {
i18nToolRef.value.state.showPopover = false
}
onBeforeUnmount(() => {
state.completionProvider?.forEach((provider) => {
provider.dispose()
Expand Down Expand Up @@ -398,6 +403,7 @@ export default {
validate,
getFormData,
insertContent,
fullscreenChange,
cancel
}
}
Expand Down

0 comments on commit dc3f7f2

Please sign in to comment.