The string returned by the backend interface requires a newline to be displayed on the frontend

foreword

The interface returns a large number of texts that need to be displayed
in a new line in order. When entering text, a newline character needs to be added at the end of \nthe new line

In the class of the front-end content, we need to add white-space: pre-line;

.content {
    
    
    //配合\n使用 实现自动换行
    white-space: pre-line;
}

Effect

2

Guess you like

Origin blog.csdn.net/Life_s/article/details/129062032