Skip to content

Commit 164f14d

Browse files
committed
Update: README.md
add browser usage example
1 parent 14efcae commit 164f14d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,36 @@ usage in SFC with script setup:
4949
</template>
5050
```
5151

52+
## Browser usage
53+
54+
```html
55+
<html>
56+
<head>
57+
<script src="https://unpkg.com/vue@3.2.37/dist/vue.global.js"></script>
58+
<script src="https://unpkg.com/v3-infinite-loading@1.2.1/lib/v3-infinite-loading.umd.js"></script>
59+
<link
60+
rel="stylesheet"
61+
href="https://unpkg.com/v3-infinite-loading@1.2.1/lib/style.css"
62+
/>
63+
</head>
64+
<body>
65+
<div id="app">
66+
<infinite-loading target="#app" @infinite="infiniteHandler"></infinite-loading>
67+
</div>
68+
<script>
69+
const { ref, createApp } = Vue;
70+
const app = createApp({
71+
// your app
72+
});
73+
app.component("infinite-loading", V3InfiniteLoading.default);
74+
app.mount("#app");
75+
</script>
76+
</body>
77+
</html>
78+
```
79+
80+
### Checkout a full working example on [codepen](https://codepen.io/oumoussa98/pen/GRxNxBr) or [github gists](https://gist.github.com/oumoussa98/7184e74bab47d78a60a8bdf0aea68d96)
81+
5282
## Usage & Guide
5383

5484
Documentation available on [v3-infinite-loading Netlify](https://vue3-infinite-loading.netlify.com/)

0 commit comments

Comments
 (0)