Commit e1a430eb authored by nick zheng's avatar nick zheng

fix: 无法预览图片

parent c283d2a1
...@@ -35,6 +35,7 @@ const fileList = ref<UploadFileInfo[]>([]) ...@@ -35,6 +35,7 @@ const fileList = ref<UploadFileInfo[]>([])
const previewImageUrl = ref('') const previewImageUrl = ref('')
const uploadPhotoRef = ref() const uploadPhotoRef = ref()
const imageRef = ref() const imageRef = ref()
const showImage = false
watch( watch(
() => props.fileArr, () => props.fileArr,
...@@ -116,4 +117,13 @@ function handleRemove(options: { file: UploadFileInfo; fileList: UploadFileInfo[ ...@@ -116,4 +117,13 @@ function handleRemove(options: { file: UploadFileInfo; fileList: UploadFileInfo[
@remove="handleRemove" @remove="handleRemove"
> >
</NUpload> </NUpload>
<NImage
v-show="showImage"
ref="imageRef"
width="100"
:src="previewImageUrl"
:show-toolbar="false"
:preview-src="previewImageUrl"
/>
</template> </template>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment