Skip to content

Commit 032e9d3

Browse files
committed
refactor: update documentation
1 parent 74cdbbb commit 032e9d3

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ const cloudimageConfig = {
134134
};
135135

136136
<template>
137-
<CloudimageProvider config={cloudimageConfig}>
137+
<CloudimageProvider v-bind:cloudImageConfig="cloudimageConfig">
138138
<h1>Simple demo of vue-cloudimage-responsive</h1>
139-
<Img src="img.jpg" alt="Demo image" ratio=1.5 blurhash="L34VB$Rj8wofayfPj@azDNj[.9WB"/>
139+
<Img src="img.jpg" alt="Demo image" v-bind:ratio="1.5" blurhash="L34VB$Rj8wofayfPj@azDNj[.9WB"/>
140140
</CloudimageProvider>
141141
</template>
142142

@@ -155,12 +155,13 @@ export default{
155155
### Img component:
156156

157157
```html
158-
<img src="img.jpg" alt="Demo image" ratio="1.5"
158+
<Img src="img.jpg" alt="Demo image" ratio="1.5"
159159
blurhash="L34VB$Rj8wofayfPj@azDNj[.9WB />
160160
```
161161
162162
NOTE: "ratio" is recommended to prevent page layout jumping. The parameter is used to calculate image height to hold
163163
the image position while image is loading.
164+
- you can also reference it with kabab-case : img
164165
165166
<a href="https://codesandbox.io/s/vue-cloudimage-responsive-blur-hash-example-b3u5n"><img src="https://codesandbox.io/static/img/play-codesandbox.svg" alt="edeit in codesandbox"/></a>
166167
@@ -171,6 +172,7 @@ the image position while image is loading.
171172
{'Your conent...'}
172173
</BackgroundImg>
173174
```
175+
NOTE: you can also reference it with kabab-case : background-img
174176

175177
<a href="https://codesandbox.io/s/vue-cloudimage-responsive-background-blur-hash-hiohl"><img src="https://codesandbox.io/static/img/play-codesandbox.svg" alt="edeit in codesandbox"/></a>
176178

@@ -408,15 +410,6 @@ detect the width of image container and set the image size accordingly. This is
408410
It is recommended to prevent page layout jumping. The parameter is used to calculate image height to hold
409411
the image position while image is loading.
410412
411-
### lazyLoading
412-
413-
###### Type: **Bool** | _optional_
414-
415-
Make it possible to disable lazyLoading for each image.
416-
417-
### lazyLoadConfig
418-
419-
###### Type: **Object** | _optional_
420413
421414
The lazyLoad configuration to [LazyLoad](https://github.com/hilongjw/vue-lazyload#props) component.
422415

examples/src/App.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,8 @@
571571
<prism>{{syntaxHighlight8}}</prism>
572572
<p>
573573
<small>
574-
NOTE: "ratio" is recommended to prevent page layout jumping.{'
575-
'} The parameter is used to calculate image height to hold the
574+
NOTE: "ratio" is recommended to prevent page layout jumping.
575+
The parameter is used to calculate image height to hold the
576576
image position while image is loading.
577577
</small>
578578
</p>
@@ -763,9 +763,9 @@ export default {
763763
data() {
764764
return {
765765
syntaxHighlight1: `<Img
766-
src="images[17].src"
767-
blurhash="images[17].blur_hash"
768-
sizes="{
766+
:src="images[17].src"
767+
:blurhash="images[17].blur_hash"
768+
:sizes="{
769769
'(max-width: 575px)': { w: 400, h: 150 },
770770
'(min-width: 576px)': { r: 1 },
771771
'(min-width: 620px)': { h: 560 },
@@ -797,7 +797,7 @@ export default {
797797
src="ameen-fahmy.jpg"
798798
params="func=crop"
799799
blurhash="L34VB$Rj8wofayfPj@azDNj[.9WB"
800-
style="background: transparent 50% 50% / cover no-repeat">...</BackgroundImg>`,
800+
:style="{background: transparent 50% 50% / cover no-repeat}">...</BackgroundImg>`,
801801
syntaxHighlight6: `import Vue from 'vue';
802802
import App from './App.vue';
803803
import VueLazyload from 'vue-lazyload';
@@ -817,9 +817,9 @@ const cloudimageConfig = {
817817
};
818818
819819
<template>
820-
<CloudimageProvider config={cloudimageConfig}>
820+
<CloudimageProvider v-bind:cloudImageConfig="cloudimageConfig">
821821
<h1>Simple demo of vue-cloudimage-responsive</h1>
822-
<Img src="img.jpg" alt="Demo image" ratio=1.5 blurhash="L34VB$Rj8wofayfPj@azDNj[.9WB" />
822+
<Img src="img.jpg" alt="Demo image" v-bind:ratio="1.5" blurhash="L34VB$Rj8wofayfPj@azDNj[.9WB" />
823823
</CloudimageProvider>
824824
</template>
825825
@@ -833,7 +833,7 @@ const cloudimageConfig = {
833833
'
834834
< /script>
835835
`,
836-
syntaxHighlight8: `<Img src="img.jpg" alt="Demo image" ratio=1.5 blurhash="LHNRn;04058E};wyIqJ8P90P%b^h"/>`,
836+
syntaxHighlight8: `<Img src="img.jpg" alt="Demo image" v-bind:ratio="1.5" blurhash="LHNRn;04058E};wyIqJ8P90P%b^h"/>`,
837837
838838
images,
839839
imagesSliced,

0 commit comments

Comments
 (0)