上传图片
- 用到u-upload组件的@afterRead和@delete事件,前者用push方法添加图片路径,后者用splice(第一个参数重哪个位置开始,第二个参数删除几个元素)删除
<template>
<view>
<u-upload :fileList="fileList" @afterRead="readImg" :deletable="true" @delete="delImg"></u-upload>
</view>
</template>
上传图片
<template>
<view>
<u-upload :fileList="fileList" @afterRead="readImg" :deletable="true" @delete="delImg"></u-upload>
</view>
</template>