好的,下面是 uniapp 框架中封装图片上传组件的示例代码:
<template>
<view class="container">
<image v-if="imageUrl" :src="imageUrl"></image>
<button @click="chooseImage">选择图片</button>
</view>
</template>
<script>
export default {
data() {
return {
imageUrl: ''
}
},
methods: {
choose