@@ -145,35 +145,36 @@ CDN traffic per month for free.
145145using npm
146146
147147```
148- npm install vue-cloudimage-responsive vue-lazyload
148+ npm install vue-cloudimage-responsive-plain vue-lazyload
149149```
150150or using yarn
151151
152152```
153- yarn add vue-cloudimage-responsive vue-lazyload
153+ yarn add vue-cloudimage-responsive-plain vue-lazyload
154154```
155155
156156## <a name =" initialize " ></a >Step 2: Initialize
157157
158- After installing the vue-cloudimage-responsive lib, simply initialize it with your ** token** and the ** baseURL**
159- of your image storage with ** CloudimageProvider ** :
160- create vue instance a fle called main.js
158+ After installing the vue-cloudimage-responsive-plain lib, simply initialize it with your ** token** and the ** baseURL**
159+ of your image storage with ** CloudImageProvider ** :
160+ create vue instance a file called main.js
161161
162162``` js
163- import Vue from ' vue'
163+ import { createApp } from ' vue'
164164import App from ' ./App.vue'
165- import VueLazyload from ' vue-lazyload'
165+ import VueLazyload from ' vue-lazyload' ;
166166
167- Vue .use (VueLazyload, {
167+ const app = createApp (App);
168+
169+ app .use (VueLazyload, {
168170 lazyComponent: true
169- })
170- new Vue ({
171- render : h => h (App)
172- }).$mount (' #app' )
171+ });
172+
173+ app .mount (' #app' );
173174```
174175
175176``` jsx
176- import Img , { CloudimageProvider } from ' vue-cloudimage-responsive-plain' ;
177+ import Img , { CloudImageProvider } from ' vue-cloudimage-responsive-plain' ;
177178
178179const cloudimageConfig = {
179180 token: ' demo' ,
@@ -182,20 +183,26 @@ const cloudimageConfig = {
182183
183184< template>
184185 < div id= " app" >
185- < CloudimageProvider v- bind: cloudImageConfig= " cloudimageConfig" >
186- < h1> Simple demo of vue- cloudimage- responsive< / h1>
186+ < CloudImageProvider v- bind: cloudImageConfig= " cloudimageConfig" >
187+ < h1> Simple demo of vue- cloudimage- responsive- plain < / h1>
187188< Img src= " img.jpg" alt= " Demo image" / >
188- < / CloudimageProvider >
189+ < / CloudImageProvider >
189190< / div>
190191< / template>
191192
192193< script>
193194export default {
194- components: {
195- CloudimageProvider,
196- Img
197- }
198- }
195+ name: " app" ,
196+ components: {
197+ CloudImageProvider,
198+ Img,
199+ },
200+ data () {
201+ return {
202+ cloudimageConfig
203+ };
204+ },
205+ },
199206< / script>
200207```
201208
@@ -216,7 +223,7 @@ the image position while image is loading.
216223### BackgroundImg component:
217224
218225``` html
219- <BackgroundImg src =" img.jpg"
226+ <BackgroundImg src =" img.jpg" >
220227 {'Your conent...'}
221228</BackgroundImg >
222229```
0 commit comments