2.0.2 • Published 11 months ago

@teamnovu/vue-cloudinary-image v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Vue-Cloudinary-Image

Responsive image component

Uses the image attributes srcSet and sizes to responsively display an an image from cloudinary.

Generates srcSet with a placeholder for lazyloading based on screen sizes passed in options and adjusts the sizes attribute depending on the screen size.

Installation

// yarn
yarn add @teamnovu/vue-cloudinary-image

// npm
npm i @teamnovu/vue-cloudinary-image

Setup

import CloudinaryImage from '@teamnovu/vue-cloudinary-image'

Vue.use(CloudinaryImage, {
  cloudinaryBaseUrl: "https://res.cloudinary.com/<your-cloud-name>/image/upload/",
});

Usage

<CloudinaryImage src="/assets/image.jpg" />

Plugin Options

OptionDefaultRequiredTypeComment
cloudinaryBaseUrlnulltrueString
screenSizesdefault screen sizesfalseObject
placeholderTransformationnullfalseStringNamed Transformation used for the placeholder transformation

Attributes

AttributeDefaultRequiredTypeDescription
srcnulltrueStringRelative path to image from cloudinaryAssetUrl
quality85falseNumberCloudinary Option
blurnullfalseNumberCloudinary Option
cropnullfalseStringCloudinary Option
format'auto'falseStringCloudinary Option
fallbackWidthnullfalseNumberIf srcSet and sizes are not supported in the clients browser, this will be the fixed width of the image itself (not css width)
aspectRationullfalseNumberIf you set this attribute the component will ignore the placeholderDataUrl attribute and load the placeholder image from cloudinary because the aspect ratio would change between placeholder and the real image
placeholderDataUrlnullfalseStringIf this attribute is set all other placeholder options are ignored and this url is used as the placeholder source
placeholderQuality30falseNumberCloudinary Option
placeholderWidth300falseNumberCloudinary Option
usePlaceholdertruefalseBooleanIf this attribute is set to false, no placeholder will be displayed and the original image will be rendered immediately
zoomundefinedfalseString, NumberZoom level
transformsundefinedfalseString, ObjectAdditional, raw transformations

Example

<CloudinaryImage
  src="/assets/image.jpg"
/>
2.0.2

11 months ago

2.0.1

11 months ago

3.0.4

11 months ago

3.0.2-dev.1

12 months ago

3.0.2-dev.2

12 months ago

3.0.2-dev.3

12 months ago

3.0.2-dev.4

12 months ago

3.0.2-dev.5

12 months ago

3.0.3

12 months ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

2.0.0

2 years ago

0.0.15

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago