更新记录

1.0.3(2024-03-30)

初步形成


平台兼容性

Vue2 Vue3
×
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
× × × × × × ×
钉钉小程序 快手小程序 飞书小程序 京东小程序
× × × ×
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari
× × × × × × × × ×

用法:

//template部分
<view class="content">
    <swiper class="header-swiper" :style="{ height: (status + navHeight + 256) + 'rpx;' }" indicator-dots="false" autoplay="true" loop="true">
          <swiper-item v-for="image in images" :key="image.id">
              <image :src="image.url"></image> 
          </swiper-item> 
    </swiper>
    <view class="myContainer">
      <ruhua-swiper-avatar class="my" :src="src" size="large" mode="circle"></ruhua-swiper-avatar>
    </view>
</view>

//vue3语法↓
<script setup>
    import { ref, reactive, computed, } from 'vue'
  import { onLoad } from '@dcloudio/uni-app'
  import { useStatusBar } from '../../composable/index.js'
  const images = ref([
        { id: 1, url: '/static/swiper/1.png' },
        { id: 2, url: '/static/swiper/2.png' },
        { id: 3, url: '/static/swiper/3.png' }
  ]);

  const { status, navHeight } = useStatusBar()

  const src = "../../static/R-C.png"

</script>

<style>
    .content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

  .header-swiper {
    width: 100%;
    position: relative;
    overflow: hidden; /* 隐藏超出的部分 */
  }

  .header-swiper image {
    width: 100%;
    max-height: 100%; /* 使用max-height代替height,防止图片过高溢出 */
    object-fit: cover; /* 保持图片比例并填充整个容器 */
  }
  .myContainer {
    border-radius: 40rpx;
    width: 140rpx;  
    height: 140rpx;  
    margin-top: -40rpx;  
    background-color: #ffffff;  
    display: flex; /* 将容器设置为flex容器 */  
    justify-content: center; /* 水平居中 */  
    align-items: center; /* 垂直居中 */  
    z-index: 1; /* 确保盒子显示在其他元素之上 */  
  }

</style>

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

暂无用户评论。

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问