0.0.0 • Published 2 years ago

z-file-upload v0.0.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

上传组件 - 默认

上传示例- 参考

<template>
   <div>
     <z-fileupload ref="dom" :modelValue="file" :uploadAction="handleUpload" :uploadSuccess="handleUploadSuccess" width="200px" height="150px">
       
     </z-fileupload>
   </div>
</template>

上传示例- 参考

<template>
   <div>
     <z-fileupload ref="dom" :modelValue="file" :uploadAction="handleUpload" :uploadSuccess="handleUploadSuccess" width="200px" height="150px">
       <template v-slot:loading="{ imageLoading }">
         加载中 {{String(imageLoading)}}
       </template>
       <template v-slot:img="{ url }">
         <img :src="url" alt="测试url" width="100" height="100">
       </template>
       <template v-slot:plus>
         +++
       </template>
     </z-fileupload>
   </div>
</template>

上传组件 - 自定义

组件属性

属性描述备注
widthstring
heightstring
modelValue预设/返回地址string

事件

属性描述备注
uploadSuccess上传成功回调参照elment-plus (response, uploadFile, uploadFiles) => void
uploadAction上传请求参考示例

ref defineExpose 方法

方法描述备注
setLoading设置加载(bool: boolean) => void
handleUploadSuccess同uploadSuccessFunction
handleUpload同uploadActionFunction

ref defineExpose 属性

方法描述备注
imageLoading加载状态boolean
0.0.0

2 years ago