图片取自uni-app官方文档https://uniapp.dcloud.io/component/text
<text>
组件内只支持嵌套<text>
,不支持其它组件或自定义组件,否则会引发在不同平台的渲染差异。- 在app-nvue下,只有
<text>
才能包裹文本内容。无法在<view>
组件包裹文本。 - decode 可以解析的有
<
>
&
'
 
 
。 - 各个操作系统的空格标准并不一致。
- 除了文本节点以外的其他节点都无法长按选中。
- 支持
\n
方式换行。 - 如果使用
<span>
组件编译时会被转换为<text>
。
vue文件代码
<template>
<view>
<view>
<text>无敌季卡拉诺在学习</text>
</view>
<view>
<text selectable>无敌季卡拉诺在学习</text>//selectable长按可选
</view>
<view>
<text selectable space="ensp">无敌季 卡拉诺在学习</text>//空格所占大小 space
</view>
</view>
</template>
<script>
</script>
<style>
</style>
显示: