上传图片、预览图片
上传图片(uni.chooseImage)
从本地相册选择图片或使用相机拍照。
案例代码
<template>
<view>
<button @click="chooseImg" type="primary">上传图片</button>
<view>
<image v-for="item in imgList" :src="item" :key="index"></image>
</view>
</view>
</template>
<script>
export default {
data () {
return {
imgList: []
}
}