<template>
<view class="content">
<image class="logo" :src="src"></image>
<view class="text-area">
<text class="title" @click="upload">{{title}}</text>
</view>
</view>
</template>  
<script>
export default {
data() {
return {
title: '上传图片',
src: ''
}
},
onLoad() {  
    },  
    methods: {  
        upload () {  
            uni.chooseImage({  
                count: 6, //默认9  
                sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有  
                // sourceType: ['album'], //从相册选择  
                success: (res) => {  
                    console.log(res);  
                    this.src = res.tempFilePaths[0]  
                    console.log(this.src);  
                }  
            });  
        }  
    }  
}  </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;  
}  
.text-area {  
    display: flex;  
    justify-content: center;  
}  
.title {  
    font-size: 36rpx;  
    color: #8f8f94;  
}  </style>
 
             
             
             
			 
                                        
                                     
            
0 个回复