You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

173 lines
6.4 KiB

  1. <template>
  2. <view>
  3. <l-title>文字大小:</l-title>
  4. <view class="bg-white padding-lr">
  5. <view
  6. class="solids-bottom padding-xs flex flex-direction justify-start align-center"
  7. >
  8. <view class="flex-sub text-center">
  9. <view class="solid-bottom text-xsl padding">
  10. <text class="cuIcon-roundcheckfill text-green"></text>
  11. 文字大小
  12. </view>
  13. <view class="padding-xs">text-xsl (60)</view>
  14. </view>
  15. </view>
  16. <view class="solids-bottom padding-xs flex align-center">
  17. <view class="flex-sub text-center">
  18. <view class="solid-bottom text-sl padding">
  19. <text class="cuIcon-roundcheckfill text-green"></text>
  20. 文字大小
  21. </view>
  22. <view class="padding-xs">text-sl (40)</view>
  23. </view>
  24. </view>
  25. <view class="solids-bottom padding-xs flex align-center">
  26. <view class="flex-sub text-center">
  27. <view class="solid-bottom text-xxl padding">
  28. <text class="cuIcon-roundcheckfill text-green"></text>
  29. 文字大小
  30. </view>
  31. <view class="padding-xs">text-xxl (22)</view>
  32. </view>
  33. </view>
  34. <view class="solids-bottom padding-xs flex align-center">
  35. <view class="flex-sub text-center">
  36. <view class="solid-bottom text-xl padding">
  37. <text class="cuIcon-roundcheckfill text-green"></text>
  38. 文字大小
  39. </view>
  40. <view class="padding-xs">text-xl (18)</view>
  41. </view>
  42. </view>
  43. <view class="solids-bottom padding-xs flex align-center">
  44. <view class="flex-sub text-center">
  45. <view class="solid-bottom text-lg padding">
  46. <text class="cuIcon-roundcheckfill text-green"></text>
  47. 文字大小
  48. </view>
  49. <view class="padding-xs">text-lg (16)</view>
  50. </view>
  51. </view>
  52. <view class="solids-bottom padding-xs flex align-center">
  53. <view class="flex-sub text-center">
  54. <view class="solid-bottom text-df padding">
  55. <text class="cuIcon-roundcheckfill text-green"></text>
  56. 文字大小
  57. </view>
  58. <view class="padding-xs">text-df (14)</view>
  59. </view>
  60. </view>
  61. <view class="solids-bottom padding-xs flex align-center">
  62. <view class="flex-sub text-center">
  63. <view class="solid-bottom text-sm padding">
  64. <text class="cuIcon-roundcheckfill text-green"></text>
  65. 文字大小
  66. </view>
  67. <view class="padding-xs">text-sm (12)</view>
  68. </view>
  69. </view>
  70. <view class="padding-xs flex align-center">
  71. <view class="flex-sub text-center">
  72. <view class="solid-bottom text-xs padding">
  73. <text class="cuIcon-roundcheckfill text-green"></text>
  74. 文字大小
  75. </view>
  76. <view class="padding-xs">text-xs (10)</view>
  77. </view>
  78. </view>
  79. </view>
  80. <l-demo-description>给文本所在的容器添加上面的类名(text-开头)即可实现设置字号</l-demo-description>
  81. <l-title>文字颜色:</l-title>
  82. <view class="grid col-5 padding-sm">
  83. <view v-for="(item, index) in colors" :key="index" class="padding-sm">
  84. <view
  85. :class="'text-' + item.name"
  86. :style="{ backgroundColor: index === colors.length - 1 ? '#555' : null }"
  87. class="text-center"
  88. >
  89. {{ item.title }} {{ item.name }}
  90. </view>
  91. </view>
  92. </view>
  93. <l-demo-description>
  94. 给文本所在的容器添加 class="text-*";
  95. 把*替换成上面的颜色的英文名,即可适用这些字体颜色
  96. </l-demo-description>
  97. <l-title>文字阴影:</l-title>
  98. <view class="padding">
  99. <view class="text-xxl text-center text-shadow text-black">文字带阴影</view>
  100. </view>
  101. <l-demo-description>
  102. 给文本所在的容器添加 class="text-shadow" 即可适用文字阴影;
  103. 注意,只有在文本已设置了颜色时阴影才会生效,例如已经设置了 class="text-black"
  104. </l-demo-description>
  105. <l-title>文字截断:</l-title>
  106. <view class="padding bg-white flex flex-wrap justify-around">
  107. <view class="text-cut padding bg-grey radius" style="width:220px">
  108. 床前明月光,疑是地上霜,举头望明月,低头思故乡
  109. </view>
  110. </view>
  111. <l-demo-description>
  112. 给文本所在的容器添加 class="text-cut";
  113. 并且设置一个宽度值,即可自动截断文字,超出时显示成省略号
  114. </l-demo-description>
  115. <l-title>文字对齐:</l-title>
  116. <view class="padding bg-white">
  117. <view class="padding text-left">(left) 床前明月光,疑是地上霜</view>
  118. <view class="padding text-center">(center) 床前明月光,疑是地上霜</view>
  119. <view class="padding text-right">(right) 床前明月光,疑是地上霜</view>
  120. </view>
  121. <l-demo-description>
  122. 给文本所在的容器添加 class="text-*";
  123. 把*替换成上述的对齐字符串(left/center/right),即可设置文本的对齐方式
  124. </l-demo-description>
  125. <l-title>特殊文字:</l-title>
  126. <view class="padding text-center">
  127. <view class="padding-lr bg-white">
  128. <view class="solid-bottom padding"><text class="text-price">100.00</text></view>
  129. <view class="padding">(text-price) 价格文本,自动添加"¥"符号</view>
  130. </view>
  131. <view class="padding-lr bg-white margin-top">
  132. <view class="solid-bottom padding">
  133. <text class="text-Abc">Taylor Swift</text>
  134. </view>
  135. <view class="padding">(text-Abc) 英文单词首字母大写</view>
  136. </view>
  137. <view class="padding-lr bg-white margin-top">
  138. <view class="solid-bottom padding">
  139. <text class="text-ABC">Taylor Swift</text>
  140. </view>
  141. <view class="padding">(text-ABC) 全部字母大写</view>
  142. </view>
  143. <view class="padding-lr bg-white margin-top">
  144. <view class="solid-bottom padding">
  145. <text class="text-abc">Taylor Swift</text>
  146. </view>
  147. <view class="padding">(text-abc) 全部字母小写</view>
  148. </view>
  149. </view>
  150. <l-demo-description>给文本所在的元素添加上面的类名(text-开头)即可实现文字特殊字体</l-demo-description>
  151. </view>
  152. </template>
  153. <script>
  154. export default {
  155. data() {
  156. return { colors: this.getUiColors() }
  157. }
  158. }
  159. </script>