11<template >
2- <div class =" cld-image" >
3- <img v-bind =" imageAttrs" :style =" style" />
2+ <div class =" cld-image" :style = " style " >
3+ <img v-bind =" imageAttrs" :style =" style" />
44 <slot ></slot >
55 </div >
66</template >
77<script >
88import { Cloudinary , Transformation } from " cloudinary-core" ;
99import { merge , range } from " ../../utils" ;
10- import { normalizeNonCloudinary , normalizeTransformation , normalizeConfiguration , getHTMLAttributes , hasZeroSizeTransformation } from " ../../helpers/attributes" ;
10+ import {
11+ normalizeNonCloudinary ,
12+ normalizeTransformation ,
13+ normalizeConfiguration ,
14+ getHTMLAttributes ,
15+ hasZeroSizeTransformation
16+ } from " ../../helpers/attributes" ;
1117import { evalBreakpoints } from " ../../helpers/evalBreakpoints" ;
1218import {
1319 getResizeTransformation ,
@@ -18,7 +24,7 @@ import { getPlaceholderURL } from "../../helpers/getPlaceholderURL";
1824import { size } from " ../../mixins/size" ;
1925import { lazy } from " ../../mixins/lazy" ;
2026import { withOptions } from " ../../mixins/withOptions" ;
21- import { generateUrl } from ' ../../helpers/URLGenerator' ;
27+ import { generateUrl } from " ../../helpers/URLGenerator" ;
2228
2329/**
2430 * Deliver images and specify image transformations using the cld-image (CldImage) component,
@@ -37,7 +43,7 @@ export default {
3743 name: " CldImage" ,
3844 provide () {
3945 return {
40- registerTransformation: this .registerTransformation ,
46+ registerTransformation: this .registerTransformation
4147 };
4248 },
4349 inject: {
@@ -99,16 +105,19 @@ export default {
99105 },
100106 methods: {
101107 registerTransformation (transformation ) {
102- this .transformations = [... this .transformations , normalizeTransformation (transformation)];
108+ this .transformations = [
109+ ... this .transformations ,
110+ normalizeTransformation (transformation)
111+ ];
103112 },
104113 computeLazyLoadSrc () {
105114 const src = getPlaceholderURL (
106- this .placeholder ,
107- this .publicId ,
108- this .configuration ,
109- this .transformOptions
110- );
111-
115+ this .placeholder ,
116+ this .publicId ,
117+ this .configuration ,
118+ this .transformOptions
119+ );
120+
112121 return {
113122 ... this .nonCldAttrs ,
114123 src
@@ -117,15 +126,17 @@ export default {
117126 },
118127 computed: {
119128 isWithoutTransformation () {
120- return ! this .publicId ||
129+ return (
130+ ! this .publicId ||
121131 hasZeroSizeTransformation (this .transformations ) ||
122132 (this .responsive && ! this .size )
133+ );
123134 },
124135 style () {
125- return getResponsiveStyle (this .responsive )
136+ return getResponsiveStyle (this .responsive );
126137 },
127138 nonCldAttrs () {
128- return normalizeNonCloudinary (this .$attrs )
139+ return normalizeNonCloudinary (this .$attrs );
129140 },
130141 transformOptions () {
131142 return {
@@ -134,10 +145,10 @@ export default {
134145 ... (this .options .transformation || []),
135146 ... this .transformations
136147 ]
137- }
148+ };
138149 },
139150 isLazyLoadInvisible () {
140- return this .lazy && ! this .visible
151+ return this .lazy && ! this .visible ;
141152 },
142153 imageAttrs () {
143154 if (this .isWithoutTransformation ) {
@@ -168,14 +179,14 @@ export default {
168179 });
169180
170181 return {
171- ... this .nonCldAttrs ,
172- ... htmlAttrs,
173- src
182+ ... this .nonCldAttrs ,
183+ ... htmlAttrs,
184+ src
174185 };
175186 },
176187 shouldMeasureSize () {
177- return ! this .responsive ;
188+ return this .responsive !== false ;
178189 }
179- },
190+ }
180191};
181192 </script >
0 commit comments