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富文本刷新及表单验证问题 #306

Open
Mtouyao opened this issue Oct 22, 2024 · 3 comments
Open

vue3富文本刷新及表单验证问题 #306

Mtouyao opened this issue Oct 22, 2024 · 3 comments

Comments

@Mtouyao
Copy link

Mtouyao commented Oct 22, 2024

当使用修改按钮时查询第一条信息,富文本框显示内容无误。
image

当再次点击第二条信息的修改时,富文本框会显示上一条信息的内容。(第二条的富文本框内容为null,不为空的情况下不不会引发此bug)
image

@Mtouyao
Copy link
Author

Mtouyao commented Oct 22, 2024

富文本框的表单验证也不生效。
image
image

@Mtouyao Mtouyao changed the title vue3富文本刷新问题 vue3富文本刷新及表单验证问题 Oct 22, 2024
@zhujinrun
Copy link

Vue3富文本刷新问题解决方案:

修改 src\components\Editor\index.vue 文件第 111 行:

watch(() => props.modelValue, (v) => {
  if (v !== content.value) {
    content.value = v == undefined ? "<p></p>" : v; // 全等 `===` 改为  等于`==`
  }
}, { immediate: true });

@Mtouyao
Copy link
Author

Mtouyao commented Nov 11, 2024

感谢!按照您的方法,问题已解决!😄

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

2 participants