Can't pass the value of result.public_id after submitting the image.
Hello!
I used the script suggested here: https://cloudinary.nuxtjs.org/examples/upload
Please tell me how can I pass the result.public_id value through $emit? Now it is not available inside the response function.
Response: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '$ emit')
Or can I use another way to pass this value to another companet?
thank you.
-
Hi Aleksandr,
After the file is uploaded to your account, the upload method would return a promise which contains an Asset with all the asset's information including the public_id, or an Error if the upload failed.
For example:
const asset = await this.$cloudinary.upload(file, {
upload_preset: 'my_preset',
});
console.log (asset);Let us know if you have any further questions.
Post is closed for comments.
Comments
1 comment