admin管理员组

文章数量:1279049

I am using React Quill to set my data. on some button clicks I am add json data in the editor of the quill. and the object which I add looks like this.

{
"key1": 1,
"key2": 2,
"spobj1":{ "tm_id1": 1234, "tm_id2": 1235},
"spobj2":{ "tm_id1": 222, "tm_id2": 333},
"key3": 1,
"metadata": {
"debug":{ "tm_id1": 1234, "tm_id2": 1235}
"json":{ "tm_id1": 222, "tm_id2": 333},
}}

and my component is

<ReactQuill
        key={1}
        ref={stdQuillRef}
        theme="bubble"
        onChange={(html) => handleQuillChange(html, type.FieldGroup)}
        value={stdText || ""}
        modules={{ toolbar: { container: [], handlers: {} } }}/>

When I add spobj1 or spobj2 to the content, I need to create a metadata object at the end as shown above.

When this object is in the editor, I want to hide the metadata object from the UI but keep it as part of the original JSON that I will save in the database.

Is there a way to achieve this? How can I set some part of the string hidden in the editor.

本文标签: reactjsHow to add hidden contents in ReactQuill EditorStack Overflow