index.vue 1010 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <script lang="ts" setup>
  2. /**
  3. * @Name: index.vue
  4. * @Description: 店铺信息页面
  5. * @Author: Cheney
  6. */
  7. import InfoCard from '/@/views/shop-information/components/InfoCard.vue';
  8. import * as api from '/@/views/shop-information/api';
  9. import { useResponse } from '/@/utils/useResponse';
  10. const cardData = ref();
  11. provide('cardData', cardData);
  12. const loading = ref(false);
  13. onBeforeMount(() => {
  14. initData();
  15. });
  16. async function initData() {
  17. const res = await useResponse({}, api.getCardData, loading);
  18. cardData.value = res.data;
  19. }
  20. </script>
  21. <template>
  22. <div class="flex flex-col px-5">
  23. <el-divider content-position="left">
  24. <div class="font-bold text-xl">店铺信息概览</div>
  25. </el-divider>
  26. <!-- 添加 flex-grow 类,确保 el-card 占据剩余空间 -->
  27. <el-card v-loading="loading" class="flex-grow" shadow="never">
  28. <InfoCard></InfoCard>
  29. </el-card>
  30. </div>
  31. </template>
  32. <style scoped>
  33. :deep(.el-divider__text.is-left) {
  34. background-color: #F5F5F5;
  35. }
  36. </style>