Skeleton - 图1

Skeleton Vue Component

Skeleton elements (aka UI Skeletons, Skeleton Screens, Ghost Elements) are basically “gray box” representations of UI that will be available soon. They are designed to improve perceived performance.

Skeleton Vue component represents Skeleton component.

Skeleton Components

There are following components included:

  • f7-skeleton-block
  • f7-skeleton-text

Skeleton Properties

PropTypeDefaultDescription
<f7-skeleton-block> properties
widthstring
number
Skeleton block width
heightstring
number
Skeleton block height
tagstringdivSkeleton block tag
<f7-skeleton-text> properties
widthstring
number
Skeleton text element width
heightstring
number
Skeleton text element height
tagstringspanSkeleton text element tag

Examples

  1. <template>
  2. <f7-page>
  3. <f7-navbar title="Skeleton"></f7-navbar>
  4. <f7-block-title>Skeleton List</f7-block-title>
  5. <f7-list media-list class="skeleton-text">
  6. <f7-list-item
  7. title="Title"
  8. subtitle="Subtitle"
  9. text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi lobortis et massa ac interdum."
  10. >
  11. <f7-skeleton-block style="width: 40px; height: 40px; border-radius: 50%" slot="media"></f7-skeleton-block>
  12. </f7-list-item>
  13. <f7-list-item
  14. title="Title"
  15. subtitle="Subtitle"
  16. text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi lobortis et massa ac interdum."
  17. >
  18. <f7-skeleton-block style="width: 40px; height: 40px; border-radius: 50%" slot="media"></f7-skeleton-block>
  19. </f7-list-item>
  20. </f7-list>
  21. <f7-block-title>Skeleton Card</f7-block-title>
  22. <f7-card
  23. class="skeleton-text"
  24. title="Card Header"
  25. content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi lobortis et massa ac interdum. Cras consequat felis at consequat hendrerit."
  26. footer="Card Footer"
  27. ></f7-card>
  28. <f7-block strong>
  29. <p>It supports few loading effects:</p>
  30. <f7-row tag="p">
  31. <f7-button fill small round class="col" @click="load('fade')">Fade</f7-button>
  32. <f7-button fill small round class="col" @click="load('blink')">Blink</f7-button>
  33. <f7-button fill small round class="col" @click="load('pulse')">Pulse</f7-button>
  34. </f7-row>
  35. </f7-block>
  36. <f7-list media-list v-if="loading">
  37. <f7-list-item
  38. v-if="loading"
  39. v-for="n in 3"
  40. :key="n"
  41. :class="`skeleton-text skeleton-effect-${effect}`"
  42. title="Full Name"
  43. subtitle="Position"
  44. text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi lobortis et massa ac interdum. Cras consequat felis at consequat hendrerit. Aliquam vestibulum vitae lorem ac iaculis. Praesent nec pharetra massa, at blandit lectus. Sed tincidunt, lectus eu convallis elementum, nibh nisi aliquet urna, nec imperdiet felis sapien at enim."
  45. >
  46. <f7-skeleton-block style="width: 40px; height: 40px; border-radius: 50%" slot="media"></f7-skeleton-block>
  47. </f7-list-item>
  48. </f7-list>
  49. <f7-list media-list v-else>
  50. <f7-list-item
  51. title="John Doe"
  52. subtitle="CEO"
  53. text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi lobortis et massa ac interdum. Cras consequat felis at consequat hendrerit. Aliquam vestibulum vitae lorem ac iaculis. Praesent nec pharetra massa, at blandit lectus. Sed tincidunt, lectus eu convallis elementum, nibh nisi aliquet urna, nec imperdiet felis sapien at enim."
  54. >
  55. <img src="https://placeimg.com/80/80/people/1" style="width: 40px; height: 40px; border-radius: 50%" slot="media">
  56. </f7-list-item>
  57. <f7-list-item
  58. title="Jane Doe"
  59. subtitle="Marketing"
  60. text="Cras consequat felis at consequat hendrerit. Aliquam vestibulum vitae lorem ac iaculis. Praesent nec pharetra massa, at blandit lectus. Sed tincidunt, lectus eu convallis elementum, nibh nisi aliquet urna, nec imperdiet felis sapien at enim."
  61. >
  62. <img src="https://placeimg.com/80/80/people/2" style="width: 40px; height: 40px; border-radius: 50%" slot="media">
  63. </f7-list-item>
  64. <f7-list-item
  65. title="Kate Johnson"
  66. subtitle="Admin"
  67. text="Sed tincidunt, lectus eu convallis elementum, nibh nisi aliquet urna, nec imperdiet felis sapien at enim."
  68. >
  69. <img src="https://placeimg.com/80/80/people/3" style="width: 40px; height: 40px; border-radius: 50%" slot="media">
  70. </f7-list-item>
  71. </f7-list>
  72. </f7-page>
  73. </template>
  74. <script>
  75. export default {
  76. data: function () {
  77. return {
  78. loading: false,
  79. effect: null,
  80. }
  81. },
  82. methods: {
  83. load: function (effect) {
  84. var self = this;
  85. if (self.loading) return;
  86. self.effect = effect;
  87. self.loading = true;
  88. setTimeout(() => {
  89. self.loading = false;
  90. }, 3000);
  91. }
  92. }
  93. }
  94. </script>

← Sheet Modal

Smart Select →