title.vue 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="uni-content">
  3. <uni-card is-full :is-shadow="false">
  4. <text class="uni-h6"> 章节标题,通常用于记录页面标题,使用当前组件在 uni-app 开启统计的情况下,将会自动统计页面标题.</text>
  5. </uni-card>
  6. <uni-section title="不同类型" type="line">
  7. <view class="example-body">
  8. <uni-title type="h1" title="h1 一级标题"></uni-title>
  9. <uni-title type="h2" title="h2 二级标题"></uni-title>
  10. <uni-title type="h3" title="h3 三级标题"></uni-title>
  11. <uni-title type="h4" title="h4 四级标题"></uni-title>
  12. <uni-title type="h5" title="h5 五级标题"></uni-title>
  13. </view>
  14. </uni-section>
  15. <uni-section title="改变颜色" type="line">
  16. <view class="example-body">
  17. <uni-title type="h1" title="h1 一级标题" color="#027fff"></uni-title>
  18. <uni-title type="h2" title="h2 二级标题" color="#2490ff"></uni-title>
  19. <uni-title type="h3" title="h3 三级标题" color="#439ffc"></uni-title>
  20. <uni-title type="h4" title="h4 四级标题" color="#60adfb"></uni-title>
  21. <uni-title type="h5" title="h5 五级标题" color="#7db9f7"></uni-title>
  22. </view>
  23. </uni-section>
  24. <uni-section title="对齐方式" type="line">
  25. <view class="example-body">
  26. <uni-title type="h1" title="h1 左对齐" align="left"></uni-title>
  27. <uni-title type="h2" title="h2 居中" align="center"></uni-title>
  28. <uni-title type="h3" title="h3 右对齐" align="right"></uni-title>
  29. <uni-title type="h4" title="h4 居中" align="center"></uni-title>
  30. <uni-title type="h5" title="h5 左对齐" align="left"></uni-title>
  31. </view>
  32. </uni-section>
  33. <uni-section title="组合示例" type="line">
  34. <view class="example-body">
  35. <view class="uni-box-head">
  36. <uni-title type="h1" align="center" title="uni-app介绍"></uni-title>
  37. </view>
  38. <view class="uni-box">
  39. <uni-title class="h3" type="h3" title="1 框架介绍"></uni-title>
  40. </view>
  41. <view class="uni-box">
  42. <uni-title class="h4" type="h4" title="1.1 什么是uni-app"></uni-title>
  43. </view>
  44. <view>
  45. <text
  46. 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"
  55. title="- 接口能力(JS API)靠近微信小程序规范,但需将前缀 wx 替换为 uni,详见uni-app接口规范"></uni-title>
  56. <uni-title class="h5" type="h5" color="#666" title="- 数据绑定及事件处理同 Vue.js 规范,同时补充了App及页面的生命周期">
  57. </uni-title>
  58. <uni-title class="h5" type="h5" color="#666" title="- 为兼容多端运行,建议使用flex布局进行开发"></uni-title>
  59. </view>
  60. </view>
  61. </uni-section>
  62. </view>
  63. </template>
  64. <script>
  65. export default {
  66. components: {},
  67. data() {
  68. return {
  69. title: '章节标题通常用于记录页面标题,例如商品标题、新闻标题等,当前组件会自动上报内容统计数据'
  70. }
  71. },
  72. onLoad() {},
  73. methods: {
  74. }
  75. }
  76. </script>
  77. <style lang="scss">
  78. .example-body {
  79. /* #ifndef APP-NVUE */
  80. display: block;
  81. /* #endif */
  82. padding: 10px;
  83. }
  84. .uni-text {
  85. font-size: 14px;
  86. line-height: 22px;
  87. color: #333;
  88. }
  89. </style>