fix: The image displayed by the application cannot be enlarged by clicking #3663 (#3799)

This commit is contained in:
shaohuzhang1 2025-08-04 13:46:32 +08:00 committed by GitHub
parent a8645b6721
commit be8d5fc715
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,5 @@
<template> <template>
<MdPreview :language="language" noIconfont noPrettier :codeFoldable="false" v-bind="$attrs" @click.stop="handleClick"/> <MdPreview :language="language" noIconfont noPrettier :codeFoldable="false" v-bind="$attrs" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -19,18 +19,10 @@ const language = computed(() => user.getLanguage() || getBrowserLang() || '')
config({ config({
editorConfig: { editorConfig: {
languageUserDefined: { languageUserDefined: {
'zh-Hant': ZH_TW 'zh-Hant': ZH_TW,
} },
} },
}) })
function handleClick(e: MouseEvent) {
if ((e.target as HTMLElement).closest('a') || (e.target as HTMLElement).closest('.md-editor-copy-button')) {
e.stopPropagation()
} else {
emit('clickPreview')
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>