title.nvue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="uni-content">
  3. <view class="example-info">
  4. <text class="example-info-text"> 章节标题,通常用于记录页面标题,使用当前组件在 uni-app 开启统计的情况下,将会自动统计页面标题 </text>
  5. </view>
  6. <uni-section title="基础用法" type="line"></uni-section>
  7. <view class="example-body">
  8. <uni-title :title="title"></uni-title>
  9. </view>
  10. <uni-section title="不同类型" type="line"></uni-section>
  11. <view class="example-body">
  12. <uni-title type="h1" title="h1 一级标题"></uni-title>
  13. <uni-title type="h2" title="h2 二级标题"></uni-title>
  14. <uni-title type="h3" title="h3 三级标题"></uni-title>
  15. <uni-title type="h4" title="h4 四级标题"></uni-title>
  16. <uni-title type="h5" title="h5 五级标题"></uni-title>
  17. </view>
  18. <uni-section title="改变颜色" type="line"></uni-section>
  19. <view class="example-body">
  20. <uni-title type="h1" title="h1 一级标题" color="#027fff"></uni-title>
  21. <uni-title type="h2" title="h2 二级标题" color="#2490ff"></uni-title>
  22. <uni-title type="h3" title="h3 三级标题" color="#439ffc"></uni-title>
  23. <uni-title type="h4" title="h4 四级标题" color="#60adfb"></uni-title>
  24. <uni-title type="h5" title="h5 五级标题" color="#7db9f7"></uni-title>
  25. </view>
  26. <uni-section title="对齐方式" type="line"></uni-section>
  27. <view class="example-body">
  28. <uni-title type="h1" title="h1 左对齐" align="left"></uni-title>
  29. <uni-title type="h2" title="h2 居中" align="center"></uni-title>
  30. <uni-title type="h3" title="h3 右对齐" align="right"></uni-title>
  31. <uni-title type="h4" title="h4 居中" align="center"></uni-title>
  32. <uni-title type="h5" title="h5 左对齐" align="left"></uni-title>
  33. </view>
  34. <uni-section title="组合示例" type="line"></uni-section>
  35. <view class="example-body">
  36. <view class="uni-box-head">
  37. <uni-title type="h1" align="center" title="uni-app介绍"></uni-title>
  38. </view>
  39. <view class="uni-box">
  40. <uni-title class="h3" type="h3" title="1 框架介绍"></uni-title>
  41. </view>
  42. <view class="uni-box">
  43. <uni-title class="h4" type="h4" title="1.1 什么是uni-app"></uni-title>
  44. </view>
  45. <view>
  46. <text class="uni-text">uni-app是一个使用Vue.js开发所有前端应用的框架,开发者编写一套代码,可发布到iOS、Android、H5、以及各种小程序(微信/支付宝/百度/头条/QQ/钉钉)等多个平台。即使不跨端,uni-app同时也是更好的小程序开发框架。DCloud公司拥有370万开发者用户,旗下uni-app有5万+案例、900款插件、50+微信/qq群,并且被阿里小程序工具内置,开发者可以放心选择。</text>
  47. </view>
  48. <view class="uni-box">
  49. <uni-title class="h4" type="h4" title="1.2 开发规范"></uni-title>
  50. </view>
  51. <view class="">
  52. <uni-title class="h5" type="h5" color="#666" title="- 页面文件遵循 Vue 单文件组件 (SFC) 规范"></uni-title>
  53. <uni-title class="h5" type="h5" color="#666" title="- 组件标签靠近小程序规范,详见uni-app 组件规范"></uni-title>
  54. <uni-title class="h5" type="h5" color="#666" title="- 接口能力(JS API)靠近微信小程序规范,但需将前缀 wx 替换为 uni,详见uni-app接口规范"></uni-title>
  55. <uni-title class="h5" type="h5" color="#666" title="- 数据绑定及事件处理同 Vue.js 规范,同时补充了App及页面的生命周期"></uni-title>
  56. <uni-title class="h5" type="h5" color="#666" title="- 为兼容多端运行,建议使用flex布局进行开发"></uni-title>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. components: {},
  64. data() {
  65. return {
  66. title: '章节标题通常用于记录页面标题,例如商品标题、新闻标题等,当前组件会自动上报内容统计数据'
  67. }
  68. },
  69. onLoad() {},
  70. methods: {
  71. }
  72. }
  73. </script>
  74. <style>
  75. @charset "UTF-8";
  76. /* 头条小程序组件内不能引入字体 */
  77. /* #ifdef MP-TOUTIAO */
  78. @font-face {
  79. font-family: uniicons;
  80. font-weight: normal;
  81. font-style: normal;
  82. src: url("~@/static/uni.ttf") format("truetype");
  83. }
  84. /* #endif */
  85. /* #ifndef APP-NVUE */
  86. page {
  87. display: flex;
  88. flex-direction: column;
  89. box-sizing: border-box;
  90. background-color: #efeff4;
  91. min-height: 100%;
  92. height: auto;
  93. }
  94. view {
  95. font-size: 14px;
  96. line-height: inherit;
  97. }
  98. .example {
  99. padding: 0 15px 15px;
  100. }
  101. .example-info {
  102. padding: 15px;
  103. color: #3b4144;
  104. background: #ffffff;
  105. }
  106. .example-body {
  107. /* #ifndef APP-NVUE */
  108. display: flex;
  109. /* #endif */
  110. flex-direction: row;
  111. flex-wrap: wrap;
  112. justify-content: center;
  113. padding: 0;
  114. font-size: 14px;
  115. background-color: #ffffff;
  116. }
  117. /* #endif */
  118. .example {
  119. padding: 0 15px;
  120. }
  121. .example-info {
  122. /* #ifndef APP-NVUE */
  123. display: block;
  124. /* #endif */
  125. padding: 15px;
  126. color: #3b4144;
  127. background-color: #ffffff;
  128. font-size: 14px;
  129. line-height: 20px;
  130. }
  131. .example-info-text {
  132. font-size: 14px;
  133. line-height: 20px;
  134. color: #3b4144;
  135. }
  136. .example-body {
  137. flex-direction: column;
  138. padding: 15px;
  139. background-color: #ffffff;
  140. }
  141. .word-btn-white {
  142. font-size: 18px;
  143. color: #FFFFFF;
  144. }
  145. .word-btn {
  146. /* #ifndef APP-NVUE */
  147. display: flex;
  148. /* #endif */
  149. flex-direction: row;
  150. align-items: center;
  151. justify-content: center;
  152. border-radius: 6px;
  153. height: 48px;
  154. margin: 15px;
  155. background-color: #007AFF;
  156. }
  157. .word-btn--hover {
  158. background-color: #4ca2ff;
  159. }
  160. .example-body {
  161. /* #ifndef APP-NVUE */
  162. display: block;
  163. /* #endif */
  164. }
  165. .uni-text {
  166. font-size: 14px;
  167. line-height: 22px;
  168. color: #333;
  169. }
  170. </style>