mx-index-paged-menus.vue 734 B

123456789101112131415161718192021
  1. <template>
  2. <view :class="[containerClass, gapClass]" class="grid">
  3. <mx-index-menus-item v-for="item in props.data" v-bind="item" :icon-size="iconSize" :title-class="titleClass"
  4. @click="emits('click', item)"/>
  5. </view>
  6. </template>
  7. <script setup>
  8. import {computed} from "vue";
  9. import {shareProps} from "./shareProps";
  10. import MxIndexMenusItem from "@/components/mx-index-menus/mx-index-menus-item.vue";
  11. const props = defineProps({...shareProps});
  12. const emits = defineEmits(["click"]);
  13. // NOTE: dynamic class name is not be allowed in tailwindcss, notice `safelist` in `tailwind.config`
  14. const containerClass = computed(() => "grid-cols-" + props.columns);
  15. </script>
  16. <style scoped>
  17. </style>