作用及定义
pre 标签可定义预格式化的文本。
被包围在 pre 标签 元素中的文本通常会保留空格和换行符。而文本也会呈现为等宽字体。
示例
用 pre 标签把字符串包起来,同时br换n
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28<template> <section class="wrap"> <h4 >示例:</h4> <div> <pre>{{str}}</pre></div> </section> </template> <script> export default { data (){ return { str:"这是一段换行n的字符串" } } } </script> <style lang="scss" scoped> .wrap{ text-align: center; h4{ font-size: 30px; margin-bottom: 20px; } } </style>
最后
以上就是野性绿茶最近收集整理的关于vue字符串中<br/>换行问题的全部内容,更多相关vue字符串中<br/>换行问题内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复