template copy.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view class="wrap">
  3. <view class="list-wrap">
  4. <u-cell-group title-bg-color="rgb(243, 244, 246)" :title="getGroupTitle(item)" v-for="(item, index) in list"
  5. :key="index">
  6. <u-cell :titleStyle="{ fontWeight: 500 }" @click="openPage(item1.path)" :title="getFieldTitle(item1)"
  7. v-for="(item1, index1) in item.list" :key="index1">
  8. <template v-slot:icon>
  9. <image class="u-cell-icon" :src="getIcon(item1.icon)" mode="widthFix"></image>
  10. </template>
  11. </u-cell>
  12. </u-cell-group>
  13. </view>
  14. <u-gap height="70"></u-gap>
  15. <!-- <u-tabbar :list="vuex_tabbar" :mid-button="true"></u-tabbar> -->
  16. </view>
  17. </template>
  18. <script>
  19. import list from "./template.config.js";
  20. export default {
  21. data() {
  22. return {
  23. list: list,
  24. // desc: '收集众多的常用页面和布局,减少开发者的重复工作,让你专注逻辑,事半功倍'
  25. }
  26. },
  27. computed: {
  28. getIcon() {
  29. return path => {
  30. return '../static/uview/demo/' + path + '.png';
  31. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  32. }
  33. },
  34. },
  35. methods: {
  36. openPage(path) {
  37. this.$u.route({
  38. url: path
  39. })
  40. },
  41. getGroupTitle(item) {
  42. return item.groupName
  43. },
  44. getFieldTitle(item) {
  45. return item.title
  46. }
  47. }
  48. }
  49. </script>
  50. <style>
  51. /* page {
  52. background-color: rgb(240, 242, 244);
  53. } */
  54. </style>
  55. <style lang="scss" scoped>
  56. .u-cell-icon {
  57. width: 36rpx;
  58. height: 36rpx;
  59. margin-right: 8rpx;
  60. }
  61. </style>