For example: In SayABC small class class, my children help each other, cooperate and compete with their friends, and are more motivated to learn! ↵From simple words to sentence patterns and scene dialogues, ↵Children are becoming more and more daring to speak English! [Yeah]↵Scan the QR code to receive foreign teacher lessons immediately [Love]↵Let your children connect with the world from an early age~
It needs to be converted to be recognized by html and line wrapped. This can be done.
'↵' is the carriage return character '/n'. This content is manually edited through textarea and submitted to the backend for storage. The characters that can be recognized in the edit box cannot be recognized in ordinary tags, so they need to be converted into recognizable characters<br/>
Method 1string.replace(/(rn|n|r)/gm, )
Then use v-html=the converted string to display line breaks normally.
Method 2The second method is to use the <pre></pre> tag. A common application of the <pre> tag is to represent computer source code. Can recognize '/n ', '/r/n ', tabs, spaces in strings...
Method 3The third method is to use <textarea></textarea> to display, so that whatever is edited there will be displayed here.
The above is the entire content of this article. I hope it will be helpful to everyone’s study. I also hope everyone will support VeVb Wulin Network.