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

如何让自定义node 既满足删除整个节点/节点内不能输入文字,又能够使用text的样式 #5813

Open
WXLKaylee opened this issue Mar 28, 2024 · 0 comments

Comments

@WXLKaylee
Copy link

WXLKaylee commented Mar 28, 2024

问题描述

富文本中需要插入动态参数,动态参数会在渲染时替换为真实的内容。所以自定义了一种新的节点类型dynamicField,使用时发现这种节点类型不能设置字体、背景色、字号、颜色等样式,应该如何操作
image

wangEditor 版本

5.1.23

是否查阅了文档 ?

(文档链接 www.wangeditor.com

最小成本的复现步骤

比如添加了一个自定义参数为 ${username},参数名称是固定的,不能轻易修改
1、动态参数设置props: { contentEditable: false }后,参数文字不能设置字体颜色等样式,比如设置为红色
2、动态参数设置props: { contentEditable: true }后,参数文字可以设置字体颜色等样式,但是参数可以被修改,如在参数中间输入 “wang” 变为 “${username_wang}”

@WXLKaylee WXLKaylee changed the title 如何让自定义node也能够使用text的样式设置? 如何让自定义node 既满足删除整个节点/节点内不能输入文字,又能够使用text的样式 Apr 7, 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

1 participant