| | |
| | | <template> |
| | | <view> |
| | | <up-upload :fileList="fileList" @afterRead="afterRead" @delete="deletePic" name="6" :maxCount="1" width="150" |
| | | <up-upload :fileList="fileList" useBeforeRead @beforeRead="afterRead" @delete="deletePic" name="6" :maxCount="1" width="150" |
| | | height="50"> |
| | | <image :src="src" mode="widthFix" style="width: 150px;height: 50px;"></image> |
| | | </up-upload> |
| | |
| | | import { |
| | | ref, |
| | | reactive, |
| | | defineProps |
| | | defineProps, |
| | | defineEmits |
| | | } from 'vue'; |
| | | const props = defineProps({ |
| | | src: { |
| | |
| | | default: '' |
| | | } |
| | | }); |
| | | const emit = defineEmits(['up-after-read']); |
| | | // let isShow = false |
| | | const fileList = reactive([{ |
| | | url: 'https://cdn.uviewui.com/uview/swiper/1.jpg', |
| | | }, ]); |
| | | const fileList = reactive([]); |
| | | const deletePic = (event) => { |
| | | fileList.splice(event.index, 1); |
| | | }; |
| | | const afterRead = () => { |
| | | |
| | | const afterRead = (event) => { |
| | | console.log(event,'event'); |
| | | emit('up-after-read', event); |
| | | }; |
| | | // 新增图片 |
| | | // const afterRead = async (event) => { |