敢为人鲜小程序前端代码仓库
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.

133 lines
5.0 KiB

  1. <template>
  2. <view class="content">
  3. <view
  4. style="height: 100rpx;background: #ecf5ff;color: #909193;display: flex;justify-content: center;text-align: center;">
  5. <text style="font-size: 28rpx;">欢迎使用多功能组件uv-vtabs这是头部内容有头部内容必须传hdHeight参数</text>
  6. </view>
  7. <uv-vtabs :chain="chain" :list="list" :height="height" hdHeight="100rpx" @change="change">
  8. <template v-for="(item, index) in list">
  9. <uv-vtabs-item :index="index" :key="index">
  10. <view class="item" v-for="(item2, index2) in item.childrens" :key="index2">
  11. <view class="item-title">
  12. <text class="text">{{ item2.name }}</text>
  13. </view>
  14. <view class="item-content">
  15. <text class="text">{{ item2.desc }}</text>
  16. </view>
  17. </view>
  18. <view class="gap" v-if="index < list.length - 1">
  19. <uv-gap bg-color="#f1f1f1" height="4"></uv-gap>
  20. </view>
  21. </uv-vtabs-item>
  22. </template>
  23. <uv-gap bg-color="#fff" height="600"></uv-gap>
  24. </uv-vtabs>
  25. </view>
  26. </template>
  27. <script>
  28. const getList = [{
  29. name: 'uv-ui简介',
  30. childrens: [{
  31. name: 'uv-ui简介',
  32. desc: '1. uv-ui最初是在uview2.x的基础上进行改进优化,支持vue3等优化,最重要的是支持单独导入直接使用,无需在main.js中进行配置。\n\n2. uv-ui来源于社区,也回归到社区,正是有一群热爱uni-app生态的同学推着它前行,而我们也一如既往的承诺,uv-ui永久开源,永远免费。但是会在下载处进行广告配置,作为开发团队的研发费用的部分来源,所以希望大家理解。'
  33. }]
  34. }, {
  35. name: 'uv-ui特点',
  36. childrens: [{
  37. name: '全端兼容',
  38. desc: 'uv-ui支持App(vue)、App(nvue)、H5、小程序、VUE2、VUE3,支持nvue原生渲染。uv-ui的组件都是多端自适应的,底层会抹平很多小程序平台的差异或bug。'
  39. }, {
  40. name: '集成工具',
  41. desc: 'uv-ui中的uv-ui-tools组件集成了强大的网络请求 HTTP 及常用的工具函数,无需自己再去寻找,并且直接挂载在uni上面,方便使用,只需要在mian.js中引入即可,更多工具请参考:https://www.uvui.cn/js/http.html。使用方式请参考:https://www.uvui.cn/components/setting.html。'
  42. }, {
  43. name: '主题扩展',
  44. desc: 'uv-ui中的uv-ui-tools组件下面的theme.scss为主题文件,直接在uni.scss中引入主题即可,可以根据自己的需求进行扩展。下面也有说明具体使用方式。使用方法请参考:https://www.uvui.cn/components/setting.html'
  45. }]
  46. }, {
  47. name: '更新日志',
  48. badge: {
  49. show: true,
  50. value: 5
  51. },
  52. childrens: [{
  53. name: '更新日志',
  54. desc: 'uv-ui的重大更新在更新日志中都有所说明,如果在开发的过程中遇到文档不完善,可以提供给我们,我们会持续完善,非常感谢大家的支持。更新日志:https://www.uvui.cn/components/changelog.html'
  55. }]
  56. }, {
  57. name: '设计规范',
  58. childrens: [{
  59. name: '设计规范',
  60. desc: '为了约束合成更多优秀的组件和模板,打造优质的体验,我们拟定了一些UI界面设计和建议。同时部分之间会有依赖,这是为了减少代码冗余的同时提高开发效率,模块化是我们的基础。如果大家有好的建议,可以提出进行改进。'
  61. }]
  62. }, {
  63. name: '交流反馈',
  64. childrens: [{
  65. name: '交流反馈',
  66. desc: 'uv-ui为采用MIT许可证的开源项目,使用完全免费。欢迎加QQ群交流反馈,一起学习,共同进步。QQ群: 549833913'
  67. }]
  68. }]
  69. export default {
  70. data() {
  71. return {
  72. list: [],
  73. chain: true
  74. }
  75. },
  76. computed: {
  77. height() {
  78. return uni.getSystemInfoSync().windowHeight - uni.upx2px(100);
  79. }
  80. },
  81. onReady() {
  82. // 模拟接口请求数据
  83. uni.showLoading({
  84. title: '加载中'
  85. })
  86. setTimeout(() => {
  87. this.list = getList;
  88. uni.hideLoading();
  89. }, 500)
  90. },
  91. methods: {
  92. change(index) {
  93. console.log('选项改变:', index)
  94. }
  95. }
  96. }
  97. </script>
  98. <style scoped lang="scss">
  99. .header {
  100. padding: 30rpx;
  101. font-size: 30rpx;
  102. color: #333;
  103. }
  104. .item {
  105. padding: 10rpx 20rpx;
  106. &-title {
  107. .text {
  108. font-weight: 700;
  109. font-size: 32rpx;
  110. color: #111;
  111. }
  112. }
  113. &-content {
  114. padding: 20rpx 0;
  115. .text {
  116. line-height: 48rpx;
  117. font-size: 30rpx;
  118. color: #111;
  119. /* #ifndef APP-NVUE */
  120. word-break: break-all;
  121. /* #endif */
  122. }
  123. }
  124. }
  125. .gap {
  126. padding: 0 30rpx;
  127. }
  128. </style>