-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
工具栏和底部布局问题 #691
Comments
给个复现问题的demo看看 |
我使用的代码: <script lang="ts" setup>
import { UPLOAD } from '@/http/http'
import { MdEditor, type Footers, type ToolbarNames, type ExposeParam } from 'md-editor-v3'
import 'md-editor-v3/lib/style.css'
import '@vavt/v3-extension/lib/asset/ExportPDF.css'
import { Emoji } from '@vavt/v3-extension'
import '@vavt/v3-extension/lib/asset/Emoji.css'
import { onMounted, ref, useTemplateRef } from 'vue'
import { SensitiveType, Status, type SensitiveTrans, Colors } from '@/type/entity'
const emit = defineEmits<{
composing: [payload: boolean]
sensitive: [payload: SensitiveTrans]
}>()
const { transColor, formStatus } = defineProps<{
transColor: string
formStatus: number | undefined
}>()
const content = defineModel<string | undefined>('content')
const editorRef = useTemplateRef<ExposeParam>('editor')
const uploadPercentage = ref(0)
const showPercentage = ref(false)
const toolbars: ToolbarNames[] = [
'revoke',
'next',
'bold',
1,
'underline',
'italic',
'-',
'title',
'strikeThrough',
'sub',
'sup',
'quote',
'unorderedList',
'orderedList',
'task',
'-',
'codeRow',
'code',
'link',
'image',
'table',
'mermaid',
'katex',
'-',
0,
'pageFullscreen',
'fullscreen',
'preview',
'htmlPreview',
'catalog',
'github'
]
const footers: Footers[] = ['markdownTotal', 0, '=', 1, 'scrollSwitch']
....omit
</script>
<template>
<md-editor
id="md-editor"
v-model="content"
:preview="false"
:toolbars="toolbars"
:toolbarsExclude="['github']"
@on-upload-img="onUploadImg"
:footers="footers"
ref="editor"
>
<template #defToolbars>
<Export-PDF v-model="content" />
<emoji>
<template #trigger> Emoji </template>
</emoji>
</template>
<template #defFooters>
<el-progress
v-if="showPercentage"
type="line"
:percentage="uploadPercentage"
:color="Colors"
status="success"
/>
<span class="trans-radius" :style="{ 'background-color': transColor }" />
</template>
</md-editor>
</template>
<style scoped>
.md-editor:deep(.md-editor-footer) {
height: 40px;
}
.trans-radius {
display: inline-flex;
width: 10px;
height: 10px;
border-radius: 50%;
}
.el-progress {
width: 100px;
display: inline-flex;
}
</style>
|
目前代码退回到4.20.2仍然会出现这个问题,只能强制修改掉package.lock里的所有文件才能恢复。似乎是这次提交引发的: 浏览器是firefox |
scrollSwitch现在需要编辑区域和预览区域同时出现才会显示,另外行高这个问题我用你的示例无法复现,看你是否能够本地创建一个基础项目,尝试能够还原后给下我源码。 ac82220 这个提交是为了居中图标而设置的。 |
行高这个问题我复现出来了。关键在于我将md-editor-v3嵌到了el-form里面,然后就会出问题。这个问题在4.20.3之前是没有的 代码如下: <script lang="ts" setup>
import { MdEditor, type Footers, type ToolbarNames, type ExposeParam } from 'md-editor-v3'
import 'md-editor-v3/lib/style.css'
import '@vavt/v3-extension/lib/asset/ExportPDF.css'
import { Emoji } from '@vavt/v3-extension'
import '@vavt/v3-extension/lib/asset/Emoji.css'
import { ref } from 'vue'
const content = ref('content')
const toolbars: ToolbarNames[] = [
'revoke',
'next',
'bold',
1,
'underline',
'italic',
'-',
'title',
'strikeThrough',
'sub',
'sup',
'quote',
'unorderedList',
'orderedList',
'task',
'-',
'codeRow',
'code',
'link',
'image',
'table',
'mermaid',
'katex',
'-',
0,
'pageFullscreen',
'fullscreen',
'preview',
'htmlPreview',
'catalog',
'github'
]
const footers: Footers[] = ['markdownTotal', 0, '=', 1, 'scrollSwitch']
const onUploadImg = async (files: File[], callback: Function) => {
console.log('aaa')
}
</script>
<template>
<el-form>
<el-form-item>
<md-editor
id="md-editor"
v-model="content"
:preview="false"
:toolbars="toolbars"
:toolbarsExclude="['github']"
@on-upload-img="onUploadImg"
:footers="footers"
ref="editor"
>
<template #defToolbars>
<Export-PDF v-model="content" />
<emoji>
<template #trigger> Emoji </template>
</emoji>
</template>
<template #defFooters>
<span class="trans-radius" :style="{ 'background-color': '#67c23a' }" />
</template>
</md-editor>
</el-form-item>
</el-form>
</template>
<style scoped>
.md-editor:deep(.md-editor-footer) {
height: 40px;
}
.trans-radius {
display: inline-flex;
width: 10px;
height: 10px;
border-radius: 50%;
}
.el-progress {
width: 100px;
display: inline-flex;
}
</style>
|
仅预览、仅编辑模式不会显示同步滚动 |
看下文字2024/10/08 00:40:21 Tuesday,本来是垂直居中的,现在不局中了 |
这个好像确实是,这个组件写得太简单了,只用了一个span标签,没有去定义样式,它应该像其他的页脚组件一样拥有 |
是的,应该框架给提供一下,否则只能业务开发去强行兼容,不太优雅 |
好,我像顶部工具栏一样,导出一个默认的底部工具栏组件,用带有默认样式的标签包裹一下 |
这段代码即使是将md-editor移出el-form,仍然无法显示出emoji和export-pdf |
我在4.20.4中修复了这个问题,尝试一下 |
应该是标签名的规则之前修改过,我改下吧 |
描述这个Bug
更新4.20.3前
顶部:
底部:
更新4.20.3后
顶部:
底部:
版本号
4.20.3
问题重现链接
No response
The text was updated successfully, but these errors were encountered: