index.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <div class="flex flex-row flex-wrap">
  3. <div
  4. v-for="(item, index) in property.list"
  5. :key="index"
  6. class="relative flex flex-col items-center p-b-14px p-t-20px"
  7. :style="{ width: `${100 * (1 / property.column)}%` }"
  8. >
  9. <!-- 右上角角标 -->
  10. <span
  11. v-if="item.badge?.show"
  12. class="absolute left-50% top-10px z-1 h-20px rounded-50% p-x-6px text-center text-12px leading-20px"
  13. :style="{ color: item.badge.textColor, backgroundColor: item.badge.bgColor }"
  14. >
  15. {{ item.badge.text }}
  16. </span>
  17. <el-image v-if="item.iconUrl" class="h-28px w-28px" :src="item.iconUrl" />
  18. <span class="m-t-8px h-16px text-12px leading-16px" :style="{ color: item.titleColor }">
  19. {{ item.title }}
  20. </span>
  21. <span class="m-t-6px h-12px text-10px leading-12px" :style="{ color: item.subtitleColor }">
  22. {{ item.subtitle }}
  23. </span>
  24. </div>
  25. </div>
  26. </template>
  27. <script setup lang="ts">
  28. import { MenuGridProperty } from './config'
  29. /** 宫格导航 */
  30. defineOptions({ name: 'MenuGrid' })
  31. defineProps<{ property: MenuGridProperty }>()
  32. </script>
  33. <style scoped lang="scss"></style>