uniapp——點擊圖片放大預覽


<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>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM