<template>
<view ref="tabview" class="main">
<button @click="beforeChooseImage">点击222</button>
</view>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, watch, computed } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'
function beforeChooseImage() {
uni.chooseImage({
count: 1,
crop: {
width: 80,
height: 80
},
success:(e:any)=>{
console.log('选择图片',e);
// setAvatar(e.tempFilePaths[0])
},
fail:(err:any)=>{
console.log('选择图片失败',err);
},
})
}
</script>
<style lang="scss" scoped>
</style>
0 个回复