Skip to content

Commit eee66e5

Browse files
committed
[Build] 1.0.0
1 parent 50500e6 commit eee66e5

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# vue-lazy-image
1+
# vue-lazy-image-loading
22

33
Vue progressive image or background loading plugin.
44

55
## Installation
66

77
```bash
8-
npm install vue-lazy-images
8+
npm install vue-lazy-image-loading
99
```
1010

1111
## Usage
1212

1313
```js
1414
import Vue from 'vue'
15-
import VueProgressiveImage from 'vue-progressive-image'
15+
import VueLazyImageLoading from 'vue-lazy-image-loading'
1616

17-
Vue.use(VueProgressiveImage)
17+
Vue.use(VueLazyImageLoading)
1818
```
1919

2020
#### Progressive image
@@ -28,15 +28,15 @@ Instead of using the normal `img` tag to load images
2828
use the `progressive-img` component already globally available after the plugin installation
2929

3030
```html
31-
<progressive-img src="https://unsplash.it/1920/1080?image=10" />
31+
<lazy-img src="https://unsplash.it/1920/1080?image=10" />
3232
```
3333

3434
#### Progressive background
3535

3636
It is also possible to apply progressive images as backgrounds and it will have the same props as the progressive-img component
3737

3838
```html
39-
<progressive-background src="https://unsplash.it/1920/1080?image=10" />
39+
<lazy-background src="https://unsplash.it/1920/1080?image=10" />
4040
```
4141

4242

@@ -47,7 +47,7 @@ To be able to immediately show some feedback to the user, it is possible to pass
4747
in this example I actually use the same image, but you have the idea here
4848

4949
```html
50-
<progressive-img
50+
<lazy-img
5151
src="https://unsplash.it/1920/1080?image=10"
5252
placeholder="https://unsplash.it/1920/1080?image=10"
5353
/>
@@ -59,20 +59,20 @@ The progressive-background has a "content" slot, which can hold content that nee
5959
This slot has one property called "visible" that tells you when, for example, a preloader needs to be visible or not.
6060

6161
```html
62-
<progressive-background src="https://unsplash.it/1920/1080?image=10">
62+
<lazy-background src="https://unsplash.it/1920/1080?image=10">
6363
<div slot="content" slot-scope="{ visible }">
6464
<p>I am some content to display over the image</p>
6565
<div v-show="visible">I am the preloader</div>
6666
</div>
67-
</progressive-background>
67+
</lazy-background>
6868
```
6969

7070
### Blur
7171

7272
It is possible to adjust the level of blur applied to the placeholder image
7373

7474
```html
75-
<progressive-img
75+
<lazy-img
7676
src="https://unsplash.it/1920/1080?image=10"
7777
placeholder="https://unsplash.it/1920/1080?image=10"
7878
:blur="30"
@@ -85,7 +85,7 @@ It is possible to remove the padding that adds the aspect ratio to the container
8585

8686

8787
```html
88-
<progressive-img
88+
<lazy-img
8989
src="https://unsplash.it/1920/1080?image=10"
9090
no-ratio
9191
/>
@@ -94,7 +94,7 @@ It is possible to remove the padding that adds the aspect ratio to the container
9494
It is also possible to manually specify the image aspact ratio when you know it. It allows the placeholder to be displayed in the correct aspect ratio. The ratio is calculated as `height / width`.
9595

9696
```html
97-
<progressive-img
97+
<lazy-img
9898
src="https://unsplash.it/1920/1080?image=10"
9999
aspect-ratio="1.5"
100100
/>
@@ -105,7 +105,7 @@ It is also possible to manually specify the image aspact ratio when you know it.
105105
In case of a loading error of the main image, it is possible to add a fallback image which can display an error image or just another image.
106106

107107
```html
108-
<progressive-img
108+
<lazy-img
109109
src="https://this_url_should_cause_an_error"
110110
fallback="https://unsplash.it/1920/1080?image=10"
111111
/>
@@ -141,7 +141,7 @@ export default {
141141
in the html just add the events you need to listen to
142142

143143
```html
144-
<progressive-img
144+
<lazy-img
145145
@onLoad="onLoad"
146146
@onLoadPlaceholder="onLoadPlaceholder"
147147
@onError="onError"
@@ -164,7 +164,7 @@ Cached images are checked by default. This check kills the animation if the imag
164164
If you would like to show the animation every time, even when is not needed, you can simply use the plugin options like so:
165165

166166
```js
167-
Vue.use(VueProgressiveImage, {
167+
Vue.use(VueLazyImageLoading, {
168168
cache: false
169169
})
170170
```
@@ -174,7 +174,7 @@ Vue.use(VueProgressiveImage, {
174174
* required: false
175175

176176
```js
177-
Vue.use(VueProgressiveImage, {
177+
Vue.use(VueLazyImageLoading, {
178178
placeholder: 'https://unsplash.it/1920/1080?image=20'
179179
})
180180
```
@@ -185,7 +185,7 @@ Vue.use(VueProgressiveImage, {
185185
* default: 5
186186

187187
```js
188-
Vue.use(VueProgressiveImage, {
188+
Vue.use(VueLazyImageLoading, {
189189
blur: 30
190190
})
191191
```
@@ -197,7 +197,7 @@ Vue.use(VueProgressiveImage, {
197197
This options is for debug only. It lets you have an easy look at the placeholder before the main image is fully loaded.
198198

199199
```js
200-
Vue.use(VueProgressiveImage, {
200+
Vue.use(VueLazyImageLoading, {
201201
delay: 2000 // 2 seconds before the image is displayed
202202
})
203203
```

config/webpack.dev.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
output: {
1111
libraryTarget: 'umd',
1212
path: path.resolve(__dirname, '../dist'),
13-
filename: 'vue-progressive-image.js'
13+
filename: 'vue-lazy-image-loading.js'
1414
},
1515
module: {
1616
rules: [babel, vue, css]

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "vue-lazy-images",
2+
"name": "vue-lazy-image-loading",
33
"version": "1.0.0",
44
"description": "Vue progressive image or background loading plugin.",
5-
"main": "dist/vue-progressive-image.js",
5+
"main": "dist/vue-lazy-image-loading.js",
66
"files": [
77
"dist"
88
],
@@ -16,7 +16,7 @@
1616
},
1717
"repository": {
1818
"type": "git",
19-
"url": "https://github.com/subotkevic/vue-lazy-image"
19+
"url": "https://github.com/subotkevic/vue-lazy-image-loading"
2020
},
2121
"keywords": [
2222
"progressive",
@@ -27,9 +27,9 @@
2727
],
2828
"license": "ISC",
2929
"bugs": {
30-
"url": "https://github.com/subotkevic/vue-lazy-image/issues"
30+
"url": "https://github.com/subotkevic/vue-lazy-image-loading/issues"
3131
},
32-
"homepage": "https://github.com/subotkevic/vue-lazy-image#readme",
32+
"homepage": "https://github.com/subotkevic/vue-lazy-image-loading#readme",
3333
"devDependencies": {
3434
"@babel/core": "^7.1.5",
3535
"@babel/preset-env": "^7.1.5",

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const mergeOptions = function (component, options = {}) {
2020
* @param {Object} [options={}]
2121
*/
2222
const install = function (Vue, options = {}) {
23-
Vue.component('progressive-img', mergeOptions(image, options))
24-
Vue.component('progressive-background', mergeOptions(background, options))
23+
Vue.component('lazy-img', mergeOptions(image, options))
24+
Vue.component('lazy-background', mergeOptions(background, options))
2525
}
2626

2727
export default {

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
export const warn = function (...message) {
66
/* eslint-disable */
7-
console.warn(`[vue-progressive-image] ${message.join(' ')}`)
7+
console.warn(`[vue-lazy-image-loading] ${message.join(' ')}`)
88
/* eslint-enable */
99
}
1010

0 commit comments

Comments
 (0)