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
{
modules: [
// Simple usage
'@nuxtjs/cloudinary',
// With options
['@nuxtjs/cloudinary', { /* module options */ }]
]
}
Or a separate section cloudinary
for module options:
{
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 install
npm run dev
Author: nuxt-community
Demo: https://cloudinary.nuxtjs.org/
Source Code: https://github.com/nuxt-community/cloudinary-module
#vuejs #vue #nuxtjs #javascript