home.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template name="basics">
  2. <view>
  3. <scroll-view scroll-y class="page">
  4. <view class="nav-list">
  5. <navigator hover-class="none" :url="'/pages/basics/' + item.name" class="nav-li" navigateTo
  6. :class="'bg-'+item.color" :style="[{animation: 'show ' + ((index+1)*0.2+1) + 's 1'}]"
  7. v-for="(item,index) in elements" :key="index">
  8. <view class="nav-title">{{item.title}}</view>
  9. <view class="nav-name">{{item.name}}</view>
  10. <text :class="'cuIcon-' + item.cuIcon"></text>
  11. </navigator>
  12. </view>
  13. <view class="cu-tabbar-height"></view>
  14. </scroll-view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. name: "basics",
  20. data() {
  21. return {
  22. elements: [{
  23. title: '布局',
  24. name: 'layout',
  25. color: 'cyan',
  26. cuIcon: 'newsfill'
  27. },
  28. {
  29. title: '背景',
  30. name: 'background',
  31. color: 'blue',
  32. cuIcon: 'colorlens'
  33. },
  34. {
  35. title: '文本',
  36. name: 'text',
  37. color: 'purple',
  38. cuIcon: 'font'
  39. },
  40. {
  41. title: '图标 ',
  42. name: 'icon',
  43. color: 'mauve',
  44. cuIcon: 'cuIcon'
  45. },
  46. {
  47. title: '按钮',
  48. name: 'button',
  49. color: 'pink',
  50. cuIcon: 'btn'
  51. },
  52. {
  53. title: '标签',
  54. name: 'tag',
  55. color: 'brown',
  56. cuIcon: 'tagfill'
  57. },
  58. {
  59. title: '头像',
  60. name: 'avatar',
  61. color: 'red',
  62. cuIcon: 'myfill'
  63. },
  64. {
  65. title: '进度条',
  66. name: 'progress',
  67. color: 'orange',
  68. cuIcon: 'icloading'
  69. },
  70. {
  71. title: '边框阴影',
  72. name: 'shadow',
  73. color: 'olive',
  74. cuIcon: 'copy'
  75. },
  76. {
  77. title: '加载',
  78. name: 'loading',
  79. color: 'green',
  80. cuIcon: 'loading2'
  81. }
  82. ],
  83. };
  84. },
  85. onShow() {
  86. console.log("success")
  87. }
  88. }
  89. </script>
  90. <style>
  91. .page {
  92. height: 100vh;
  93. }
  94. </style>