components.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="wrap">
  3. <page-nav :desc="desc" title="nav.components"></page-nav>
  4. <view class="list-wrap">
  5. <u-cell-group title-bg-color="rgb(243, 244, 246)" :title="getGroupTitle(item)" v-for="(item, index) in list" :key="index">
  6. <u-cell-item :titleStyle="{fontWeight: 500}" @click="openPage(item1.path)" :title="getFieldTitle(item1)"
  7. v-for="(item1, index1) in item.list" :key="index1">
  8. <image slot="icon" class="u-cell-icon" :src="getIcon(item1.icon)" mode="widthFix"></image>
  9. </u-cell-item>
  10. </u-cell-group>
  11. </view>
  12. <u-gap height="70"></u-gap>
  13. <!-- <u-tabbar :list="vuex_tabbar" :mid-button="true"></u-tabbar> -->
  14. </view>
  15. </template>
  16. <script>
  17. import list from "./components.config.js";
  18. export default {
  19. data() {
  20. return {
  21. list: list,
  22. //desc: '众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让你快速集成,开箱即用。',
  23. }
  24. },
  25. computed: {
  26. getIcon() {
  27. return path => {
  28. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  29. }
  30. },
  31. desc() {
  32. return this.$t('components.desc');
  33. }
  34. },
  35. onShow() {
  36. uni.setNavigationBarTitle({
  37. title: this.$t('nav.components')
  38. });
  39. },
  40. created() {
  41. },
  42. methods: {
  43. openPage(path) {
  44. this.$u.route({
  45. url: path
  46. })
  47. },
  48. getGroupTitle(item) {
  49. return this.$i18n.locale == 'zh' ? item.groupName : item.groupName_en
  50. },
  51. getFieldTitle(item) {
  52. return this.$i18n.locale == 'zh' ? item.title : item.title_en
  53. }
  54. }
  55. }
  56. </script>
  57. <style>
  58. /* page {
  59. background-color: rgb(240, 242, 244);
  60. } */
  61. </style>
  62. <style lang="scss" scoped>
  63. .u-cell-icon {
  64. width: 36rpx;
  65. height: 36rpx;
  66. margin-right: 8rpx;
  67. }
  68. </style>