Gun-Vue docs v0.21.4 • Docs
Gun-Vue docs v0.21.4 / File / usePictureUpload
Function: usePictureUpload()
usePictureUpload(
options
):PictureUploadData
Process an uploaded picture by rendering in into a canvas with given size. Returns a base64 encoded image to be stored and displayed as img.src
Parameters
• options: PictureUploadOptions
Returns
Example
ts
const src = ref(null)
const {state, handleUpload} = usePictureUpload({
preserveRatio: true,
})
watch(()=>state.output, file => src.value = file.content)