Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
selimdoyranli committed May 7, 2023
1 parent 52a05f2 commit 4245aa9
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Vue component render when visible 👁️⚡️
## Installation

```js
yarn add v-lazy-component # or npm i v-lazy-component -S
yarn add v-lazy-component # or npm i v-lazy-component
```

### Vue3
Expand All @@ -80,8 +80,8 @@ import LazyComponent from 'v-lazy-component'
```
#### Via CDN
```js
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script src="https://unpkg.com/v-lazy-component/v-lazy-component.global.js"></script>
<script src="https://unpkg.com/vue@3"></script>
<script src="https://unpkg.com/v-lazy-component"></script>

<script>
const app = Vue.createApp({})
Expand Down Expand Up @@ -114,7 +114,8 @@ export default {
```
#### Via CDN
```js
<script src="https://unpkg.com/v-lazy-component/dist/vue2/v-lazy-component.global.js"></script>
<script src="https://unpkg.com/vue@2"></script>
<script src="https://unpkg.com/v-lazy-component/vue2"></script>

<script>
new Vue({
Expand All @@ -132,7 +133,10 @@ Vue.use(LazyComponent);
<lazy-component wrapper-tag="section" @intersected="optionalDispatch">
<your-component/>

<span slot="placeholder">Loading..</span> <!-- Optional -->
<!-- Optional -->
<template #placeholder>
<span>Loading...</span>
</template>
</lazy-component>
```

Expand All @@ -144,7 +148,10 @@ idle variant
<lazy-component :is-intersected="isIntersected" idle>
<your-component/>

<span slot="placeholder">Loading..</span> <!-- Optional -->
<!-- Optional -->
<template #placeholder>
<span>Loading...</span>
</template>
</lazy-component>
```

Expand Down

0 comments on commit 4245aa9

Please sign in to comment.