<template>
  <view class="skeleton-carousel">
    <view class="skeleton-swiper"></view>
    <!-- 指示点 -->
    <view class="skeleton-indicator">
      <view class="skeleton-dot"></view>
      <view class="skeleton-dot"></view>
      <view class="skeleton-dot"></view>
      <view class="skeleton-dot"></view>
    </view>
  </view>
</template>
<style>
  .skeleton-carousel {
    width: 100%;
    height: 200px;
    background-color: #f2f2f2;
    position: relative;
  }

  .skeleton-swiper {
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    position: absolute;
    top: 0;
    left: 0;
  }

  .skeleton-indicator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .skeleton-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #c6c6c6;
    margin: 0 5px;
  }
</style
根据以下代码书写骨架屏并且写出style样式template view class=carousel swiper circular=true autoplay=false interval=3000 change=onChange swiper-item v-for=item in bannerList key=itemid

原文地址: https://www.cveoy.top/t/topic/ijyM 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录