loading-state.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <el-space direction="vertical" alignment="flex-start">
  3. <div>
  4. <label style="margin-right: 16px">Switch Loading</label>
  5. <el-switch v-model="loading" />
  6. </div>
  7. <el-skeleton style="width: 240px" :loading="loading" animated>
  8. <template #template>
  9. <el-skeleton-item variant="image" style="width: 240px; height: 240px" />
  10. <div style="padding: 14px">
  11. <el-skeleton-item variant="h3" style="width: 50%" />
  12. <div style="display: flex; align-items: center; justify-items: space-between; margin-top: 16px; height: 16px">
  13. <el-skeleton-item variant="text" style="margin-right: 16px" />
  14. <el-skeleton-item variant="text" style="width: 30%" />
  15. </div>
  16. </div>
  17. </template>
  18. <template #default>
  19. <el-card :body-style="{ padding: '0px', marginBottom: '1px' }">
  20. <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image" />
  21. <div style="padding: 14px">
  22. <span>Delicious hamburger</span>
  23. <div class="bottom card-header">
  24. <div class="time">{{ currentDate }}</div>
  25. <el-button text class="button">Operation button</el-button>
  26. </div>
  27. </div>
  28. </el-card>
  29. </template>
  30. </el-skeleton>
  31. </el-space>
  32. </template>
  33. <script lang="ts" setup>
  34. import { ref } from 'vue'
  35. const loading = ref(true)
  36. const currentDate = new Date().toDateString()
  37. </script>