Skip to content
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

vue3版本的加粗没有效果 #6023

Open
tt-a1i opened this issue Jan 18, 2025 · 0 comments
Open

vue3版本的加粗没有效果 #6023

tt-a1i opened this issue Jan 18, 2025 · 0 comments

Comments

@tt-a1i
Copy link

tt-a1i commented Jan 18, 2025

bug 描述

vue3版本的加粗没有效果
请输入内容……
vue3版本的加粗没有效果

你预期的样子是?

正常加粗
请输入内容……

系统和浏览器及版本号

windows11, chrome131

  • 操作系统
  • 浏览器和版本

wangEditor 版本

5.1.12
请输入内容……

demo 能否复现该 bug ?


能/不能

在线 demo

请尽量提供在线 demo (推荐以下网站),帮助我们最低成本复现 bug

最小成本的复现步骤

<script> import '@wangeditor/editor/dist/css/style.css' // 引入 css

import { onBeforeUnmount, ref, shallowRef, onMounted } from 'vue'
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'

export default {
components: { Editor, Toolbar },
setup() {
// 编辑器实例,必须用 shallowRef
const editorRef = shallowRef()

  // 内容 HTML
  const valueHtml = ref('<p>hello</p>')

  // 模拟 ajax 异步获取内容
  onMounted(() => {
    setTimeout(() => {
      valueHtml.value = '<p>模拟 Ajax 异步设置内容</p>'
    }, 1500)
  })

  const toolbarConfig = {}
  const editorConfig = { placeholder: '请输入内容...' }

  // 组件销毁时,也及时销毁编辑器
  onBeforeUnmount(() => {
    const editor = editorRef.value
    if (editor == null) return
    editor.destroy()
  })

  const handleCreated = (editor) => {
    editorRef.value = editor // 记录 editor 实例,重要!
  }

  return {
    editorRef,
    valueHtml,
    mode: 'default', // 或 'simple'
    toolbarConfig,
    editorConfig,
    handleCreated,
  }
},

}
</script>
(请告诉我们,如何最快的复现该 bug)
vue3中复制的官网的vue3代码

  • 步骤一
  • 步骤二
  • 步骤三
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant