Cloudinary integration with for NuxtJS
@nuxtjs/cloudinary dependency to your project# using yarn
yarn add @nuxtjs/cloudinary
# using npm
npm install @nuxtjs/cloudinary
@nuxtjs/cloudinary to the modules section of nuxt.config.js/// nuxt.config.js
{
modules: [
// Simple usage
'@nuxtjs/cloudinary',
// With options
['@nuxtjs/cloudinary', { /* module options */ }]
]
}
Or a separate section cloudinary for module options:
// nuxt.config.js
{
modules: [
// Simple usage
'@nuxtjs/cloudinary',
],
cloudinary: {
cloudName: '<your-cloudinary-cloudname>',
/* all other options */
}
}
See module options.
This module globally injects $cloudinary instance to the application. You can access it anywhere using this.$cloudinary (within a component), or context.$cloudinary (for plugins, asyncData, fetch, nuxtServerInit and middleware).
Simple use example:
const url = this.$cloudinary.image
.url('sample', { crop: 'scale', width: 200 })
See Usage - Build Image URLs and Tags.
This module uses the official Vue components built for Cloudinary and registers the following components for use in the application: CldImage, CldVideo and other supportive components.
yarn install or npm installnpm run devCopyright ©
Maintained by Maya Shavin
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.