current position:Home>vue-quill-editor rich text editor will clear spaces for content, filter empty strings, spaces; solution

vue-quill-editor rich text editor will clear spaces for content, filter empty strings, spaces; solution

2022-08-06 16:25:06cplvfx

vue-quill-editor rich text editor will clear spaces for content, filter empty strings, spaces; solution

Question:

After the content (string) written in the rich text editor is retrieved from the database, it will be displayed in a normal div, and the spaces will be cleared by default

Solution:


Add a style to the tag to display the content: style="white-space:pre-wrap;"(while keeping the space, it will wrap)

Note: When vue-quill-editor edits the style, it is achieved by adding the class name. When the page obtains data, make sure that the page introduces theThe style file of vue-quill-editor, otherwise it will have no effect


Please see the details

copyright notice
author[cplvfx],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/218/202208061619554631.html

Random recommended