更新记录

v0.0.1(2023-07-17)

实现1-9张图片显示


平台兼容性

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

微信朋友圈照片显示

参数

参数名 类型 描述
list Array 图片list,必填
width Number 宽度, 默认 500, 单位rpx
spacing Number item 间距, 默认6, 单位rpx
emptyTxt String 为空显示内容, 默认empty
mode String 排列方式: multiple多列(默认),single单列

使用

<template>
    <view class="content">
    <!-- 单列模式 -->
        <GPictures mode="single" :list="imgs(9)" />
        <view class="box"></view>

        <GPictures :list="imgs(9)" />
        <view class="box"></view>

        <GPictures :list="imgs(8)" :width="600" />
        <view class="box"></view>

        <GPictures :list="imgs(7)" :spacing="10" />
        <view class="box"></view>

        <GPictures :list="imgs(6)" />
        <view class="box"></view>

        <GPictures :list="imgs(5)" />
        <view class="box"></view>

        <GPictures :list="imgs(4)" />
        <view class="box"></view>

        <GPictures :list="imgs(3)" />
        <view class="box"></view>

        <GPictures :list="imgs(2)" />
        <view class="box"></view>

        <GPictures :list="imgs(1)" />
        <view class="box"></view>

        <!-- 宽 -->
        <GPictures :list="[wImg]" />
        <view class="box"></view>

        <!-- 高 -->
        <GPictures :list="[hImg]" />
        <view class="box"></view>

        <GPictures :list="imgs(0)" />
        <view class="box"></view>

    </view>
</template>

<script>
    import GPictures from "@/components/g-pictures/g-pictures.vue"

    export default {
        components: {
            GPictures
        },
        data() {
            return {
                wImg: require("../../static/g-pictures/img3.png"),
                hImg: require("../../static/g-pictures/img2.png")
            }
        },
        methods: {
            imgs(n) {
                let url = require(
                    "../../static/g-pictures/img1.jpeg"
                )
                return Array.from(Array(n)).map((item, index) => {
                    return url
                })
            }
        }
    }
</script>

<style>
    .content {
        width: 500rpx;
        padding-top: 80rpx;
        margin: 0 auto;
    }

    .box {
        height: 80rpx;
    }
</style>

隐私、权限声明

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

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

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

许可协议

MIT协议

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