首页 > 移动平台 > 详细

uniapp——点击图片放大预览

时间:2021-08-29 20:43:26      阅读:13      评论:0      收藏:0      [点我收藏+]
<template>
    <view class="content">
        <image class="logo" src="/static/logo.png" @click="clickImg"></image>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                title: Hello,
            }
        },
        onLoad() {

        },
        methods: {
            clickImg() {
                wx.previewImage({
                    urls: ["/static/logo.png"], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
                    current: ‘‘, // 当前显示图片的http链接,默认是第一个
                    success: function(res) {},
                    fail: function(res) {},
                    complete: function(res) {},
                })
            },
        }
    }
</script>

<style>
    .content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    .logo {
        height: 200rpx;
        width: 200rpx;
        margin-top: 200rpx;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 50rpx;
    }
</style>

 

uniapp——点击图片放大预览

原文:https://www.cnblogs.com/xiadongqing/p/15203062.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!