Skip to content

Commit 95bf7f2

Browse files
committed
docs: chagne README
1 parent 353f8be commit 95bf7f2

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# vue-lazy-loading
22

3-
> *alpha* a vue plugin to better supporting lazy loading for image and iframe
3+
> a vue plugin to better supporting lazy loading for image and iframe
44
55
**The plugin will preferentially use native image and iframe [lazy-loading](https://caniuse.com/#feat=loading-lazy-attr), if the browser does not support it, it will be implemented through [IntersectionObserver](https://caniuse.com/#feat=intersectionobserver)**
66

@@ -80,6 +80,17 @@ Use the native image lazy-loading for the web
8080

8181
rootMargin for IntersectionObserver
8282

83+
## Load animation
84+
85+
Loading animation is not included by default. You can use it this way
86+
87+
``` css
88+
img,
89+
iframe {
90+
background: rgba(50, 50, 50, 0.3) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="white"><path opacity=".25" d="M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"/><path d="M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"><animateTransform attributeName="transform" type="rotate" from="0 16 16" to="360 16 16" dur="0.8s" repeatCount="indefinite" /></path></svg>') center no-repeat;
91+
}
92+
```
93+
8394
## Browser Support
8495

8596
Available in [latest browsers](http://caniuse.com/#feat=intersectionobserver). If browser support is not available (eg IE), then make use of this [polyfill](https://www.npmjs.com/package/intersection-observer).

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
},
2626
"homepage": "https://github.com/tolking/vue-lazy-loading#readme",
2727
"devDependencies": {
28+
"@types/node": "^14.0.14",
2829
"typescript": "^3.9.5"
2930
}
3031
}

src/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class LazyCore {
6666
}
6767
break
6868
default:
69-
error('One of [v-lazy="URL", v-lazy:bg="URL", v-lazy:background="URL", v-lazy:set="URL" v-lazy:srcset="URL"]')
69+
error('One of [v-lazy="URL", v-lazy:bg="URL", v-lazy:background="URL", v-lazy:set="URL", v-lazy:srcset="URL"]')
7070
break;
7171
}
7272
} else {
@@ -82,7 +82,7 @@ export class LazyCore {
8282
}
8383
}
8484

85-
unbind(el: Element) {
85+
unbind(el: Element) {
8686
if (this.type === 'observer') {
8787
this.io?.unobserve(el)
8888
}

0 commit comments

Comments
 (0)