您的位置:首页 > 汽车 > 新车 > 外贸推广具体是做什么_软件工程师简历_什么是seo?_外链官网

外贸推广具体是做什么_软件工程师简历_什么是seo?_外链官网

2025/9/29 1:52:21 来源:https://blog.csdn.net/weixin_47517731/article/details/144473018  浏览:    关键词:外贸推广具体是做什么_软件工程师简历_什么是seo?_外链官网
外贸推广具体是做什么_软件工程师简历_什么是seo?_外链官网

uniapp + uview  图片列表预览组件

注意:在app端需要先判断是否存在手机相册权限

<template><!-- css使用的是uview1.0组件中的css --><!-- u-image  使用的是uview1.0的组件 --><view class="u-flex u-row-between u-flex-wrap"><view class="u-m-b-24" v-for="(item, index) in imgList" :key="index"><u-image @click="preImg(index)" :border-radius="borderRadius" :width="width" :height="height" :src="item[name]"></u-image></view><view :style="{ width: width }" v-for="i in remaining" :key="i"></view></view>
</template>

 

<script>
export default {props: {/* 图片宽度 */width: {type: String,default: '144rpx'},/* 图片高度 */height: {type: String,default: '144rpx'},/* 图片圆角 */borderRadius: {type: [String, Number],default: '8'},/* 图片数组 */imgList: {type: Array,default: () => {return [];}},/* 组件内部读取的imgList参数中的属性名 */name: {type: String,default: 'image'},/* 可空余几个位置 */remaining: {type: Number,default: 0},/* 是否可循环预览,默认值为 false */loop: {type: Boolean,default: false}},methods: {preImg(index) {/* app端需要在这里先判断是否已开启相册权限 */let urls = [];this.imgList.map((item, i) => {if (index == i) {urls.unshift(item[this.name]);} else {urls.push(item[this.name]);}});uni.previewImage({urls,loop:this.loop});}}
};
</script>

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com