home.vue 2.2 KB

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