You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportdefault{methods: {beforeRead(file){if(file.type!=='image/jpeg'){Toast('Please upload an image in jpg format');returnfalse;}returntrue;},asyncBeforeRead(file){returnnewPromise((resolve,reject)=>{if(file.type!=='image/jpeg'){Toast('Please upload an image in jpg format');reject();}else{resolve();}});}}}
API
Props
Attribute
Description
Type
Default
name
Input name
`string
number`
accept
Accepted file type
string
image/*
preview-image
Whether to show image preview
boolean
true
preview-size
Size of preview image
`string
number`
multiple
Whether to enable multiple selection pictures
boolean
false
disabled
Whether to disabled the upload
boolean
false
capture
Capture,can be set to camera
string
-
after-read
Hook after reading the file
Function
-
before-read
Hook before reading the file, return false to stop reading the file, can return Promise
Function
-
before-delete
Hook before delete the file, return false to stop reading the file, can return Promise
Function
-
max-size
Max size of file
number
-
max-count
Max count of image
number
-
result-type
Type of file read result, can be set to dataUrltext