From ef1114c22614762e54e49bc7c600d2a2cd460791 Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期二, 20 八月 2024 17:20:18 +0800 Subject: [PATCH] 页面搭建 --- src/components/tem/tem-upload.vue | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/tem/tem-upload.vue b/src/components/tem/tem-upload.vue index 8c228d0..d93d108 100644 --- a/src/components/tem/tem-upload.vue +++ b/src/components/tem/tem-upload.vue @@ -1,6 +1,6 @@ <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> @@ -11,7 +11,8 @@ import { ref, reactive, - defineProps + defineProps, + defineEmits } from 'vue'; const props = defineProps({ src: { @@ -19,15 +20,15 @@ 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) => { -- Gitblit v1.9.1