How to use the $img utility with script setup in Nuxt? #811
-
I am trying to generate a URL programmatically and I want to use the $img utility from Nuxt/Image. I am using Cloudinary as a provider. My nuxt.config.ts looks like this:
How do I go about it? The docs currently say use: I am trying the following:
Also, the following message shows up in VS Code: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
To answer my own question. I was reading the old docs (for Nuxt 2). These are the correct once: https://v1.image.nuxtjs.org/api/dollarimg This works:
However, |
Beta Was this translation helpful? Give feedback.
To answer my own question. I was reading the old docs (for Nuxt 2). These are the correct once: https://v1.image.nuxtjs.org/api/dollarimg
This works:
However,
myImgUrl
seems to be of typeany
.