nuxt-modules / cloudinary

Cloudinary Module for Nuxt
https://cloudinary.nuxtjs.org
MIT License
245 stars 31 forks source link

Events not triggering #205

Closed Kaperskyguru closed 3 months ago

Kaperskyguru commented 3 months ago

How do I get the PublicID or Result info from the uploaded image using Nuxt 3

Here's my code

<CldUploadWidget
                :options="{
                  showPoweredBy: false,
                  folder: '/Get Backend Jobs/logos',
                  multiple: false,
                  sources: ['local', 'url'],
                  clientAllowedFormats: ['jpeg', 'png', 'jpg'],
                }"
                v-slot="{ open }"
                signatureEndpoint="/api/sign-cloudinary-params"
                @onSuccess="
                  (result, o) => {
                    console.log(result, o);
                  }
                "
              >
                <button
                  class="py-2 px-3 bg-blue-600 rounded text-white"
                  type="button"
                  @click="open"
                >
                  Upload an Image
                </button>
              </CldUploadWidget>

None of the events are triggering

Baroshem commented 3 months ago

Hey Buddy,

Thanks for reporting this issue. I am away from keyboard right now but will be back to you in a few hours with an answer :)

Baroshem commented 3 months ago

Hey,

Thanks for patience!

There was a bug in the implementation that was catching the display-hidden event instead of success. I have fixed it in 2.7.3 version.

I verified locally and in another project that following setup works:

  <CldUploadWidget
    v-slot="{ open }"
    upload-preset="nuxt-cloudinary-unsigned"
    :on-upload="
      (result, w) => {
        console.log(result, w);
      }
    "
  >

image

Could you check if it works on your side?

Kaperskyguru commented 3 months ago

Thank you for your quick response. This was fixed

Baroshem commented 3 months ago

Great, closing the issue then.

If you have any issues or problems, please let us know and we will try the best we can :)