Skip to content

Commit 0c63620

Browse files
authored
Merge pull request #10 from scaleflex/Improve-upgrade-to-Vue3-T5565
Improve: upgrade to Vue 3 - T5565
2 parents 43035a9 + f6302d6 commit 0c63620

File tree

10 files changed

+6633
-370
lines changed

10 files changed

+6633
-370
lines changed

README.md

Lines changed: 53 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Release](https://img.shields.io/badge/release-v1.3.5-blue.svg)](https://github.com/scaleflex/js-cloudimage-responsive/releases)
1+
[![Release](https://img.shields.io/github/v/release/scaleflex/vue-cloudimage-responsive-plain)](https://github.com/scaleflex/vue-cloudimage-responsive-plain/releases)
22
[![Free plan](https://img.shields.io/badge/price-includes%20free%20plan-green.svg)](https://www.cloudimage.io/en/home#b38181a6-b9c8-4015-9742-7b1a1ad382d5)
33
[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)](#contributing)
44
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
@@ -69,6 +69,7 @@ Cloudimage, contact us at
6969

7070
- [Demo](#demo)
7171
- [Responsive plugins family](#plugin_family)
72+
- [Compatibility](#compatibility)
7273
- [Requirements](#requirements)
7374
- [Step 1: Installation](#installation)
7475
- [Step 2: Initialize](#initialize)
@@ -107,11 +108,29 @@ In order to use Cloudimage responsive plugins on your single-page application, p
107108
<a href="https://github.com/scaleflex/react-cloudimage-responsive-plain">React Cloudimage Responsive (Plain)</a>
108109
</details>
109110

111+
<details>
112+
<summary>Next.js</summary>
113+
<a href="https://github.com/scaleflex/next-cloudimage-responsive">Vue Cloudimage Responsive (Low Quality Preview)</a><br/>
114+
</details>
115+
116+
<details>
117+
<summary>Vue.js</summary>
118+
<a href="https://github.com/scaleflex/vue-cloudimage-responsive">Vue Cloudimage Responsive (Low Quality Preview)</a><br/>
119+
<a href="https://github.com/scaleflex/vue-cloudimage-responsive-blur-hash">Vue Cloudimage Responsive (Blur-hash)</a><br/>
120+
<a href="https://github.com/scaleflex/vue-cloudimage-responsive-plain">Vue Cloudimage Responsive (Plain)</a>
121+
</details>
122+
110123
<details>
111124
<summary>Angular</summary>
112125
<a href="https://github.com/scaleflex/ng-cloudimage-responsive">Angular Cloudimage Responsive (Low Quality Preview)</a><br/>
113126
</details>
114127

128+
## <a name="compatibility"></a> Compatibility
129+
| Version | Vue Version |
130+
|---------|--------------|
131+
| >2.0.0 | >=3.x.x |
132+
| <=2.0.0 | <=2.x.x |
133+
115134
## <a name="requirements"/> Requirements
116135

117136
To use the Cloudimage Responsive plugin, you will need a
@@ -126,30 +145,36 @@ CDN traffic per month for free.
126145
using npm
127146

128147
```
129-
$ npm install --save vue-cloudimage-responsive-plain
148+
npm install vue-cloudimage-responsive-plain vue-lazyload
149+
```
150+
or using yarn
151+
152+
```
153+
yarn add vue-cloudimage-responsive-plain vue-lazyload
130154
```
131155

132156
## <a name="initialize"></a>Step 2: Initialize
133157

134-
After installing the vue-cloudimage-responsive lib, simply initialize it with your **token** and the **baseURL**
135-
of your image storage with **CloudimageProvider**:
136-
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
137161

138162
```js
139-
import Vue from 'vue'
163+
import { createApp } from 'vue'
140164
import App from './App.vue'
141-
import VueLazyload from 'vue-lazyload'
165+
import VueLazyload from 'vue-lazyload';
142166

143-
Vue.use(VueLazyload, {
167+
const app = createApp(App);
168+
169+
app.use(VueLazyload, {
144170
lazyComponent: true
145-
})
146-
new Vue({
147-
render: h => h(App)
148-
}).$mount('#app')
171+
});
172+
173+
app.mount('#app');
149174
```
150175

151176
```jsx
152-
import Img, { CloudimageProvider } from 'vue-cloudimage-responsive-plain';
177+
import Img, { CloudImageProvider } from 'vue-cloudimage-responsive-plain';
153178

154179
const cloudimageConfig = {
155180
token: 'demo',
@@ -158,20 +183,26 @@ const cloudimageConfig = {
158183

159184
<template>
160185
<div id="app">
161-
<CloudimageProvider v-bind:cloudImageConfig="cloudimageConfig">
162-
<h1>Simple demo of vue-cloudimage-responsive</h1>
186+
<CloudImageProvider v-bind:cloudImageConfig="cloudimageConfig">
187+
<h1>Simple demo of vue-cloudimage-responsive-plain</h1>
163188
<Img src="img.jpg" alt="Demo image" />
164-
</CloudimageProvider>
189+
</CloudImageProvider>
165190
</div>
166191
</template>
167192

168193
<script>
169194
export default{
170-
components:{
171-
CloudimageProvider,
172-
Img
173-
}
174-
}
195+
name: "app",
196+
components: {
197+
CloudImageProvider,
198+
Img,
199+
},
200+
data() {
201+
return {
202+
cloudimageConfig
203+
};
204+
},
205+
},
175206
</script>
176207
```
177208

@@ -192,7 +223,7 @@ the image position while image is loading.
192223
### BackgroundImg component:
193224

194225
```html
195-
<BackgroundImg src="img.jpg"
226+
<BackgroundImg src="img.jpg">
196227
{'Your conent...'}
197228
</BackgroundImg>
198229
```

0 commit comments

Comments
 (0)