From a13674a5fcc00d1c4cdd5d83a17392672d898b92 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 27 Jun 2021 20:28:07 +0200 Subject: [PATCH] Merge branch 'main' of https://github.com/peshrawahmed/nuxt-render-on-scroll into main --- README.md | 16 +++++++++++++++- dev/serve.vue | 16 ++++++++++++++++ dist/render-on-scroll.esm.js | 5 ++++- dist/render-on-scroll.min.js | 2 +- dist/render-on-scroll.ssr.js | 7 +++++-- src/render-on-scroll.vue | 3 +++ 6 files changed, 44 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 48a019a..f69e2c1 100644 --- a/README.md +++ b/README.md @@ -51,12 +51,26 @@ export default { ``` +## Placeholder Support +A placeholder can also be shown before the scroll reaches the element. This will be usefull if you want to show something else while the component is rendering or if you are fetching asynchronous data from. +```html + + +
This content will be renderd only when it enters viewport
+
+``` + + ## Configuration Options | prop | type | default | comments | | ------- | :----: | ------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | height | String | '' | CSS string for height property of the wrapping div. Useful to preserve the space while to content is not rendered yet. Can be used in combination with a negative value `offsetY` render only when scrolled into the content area, e.g., for large charts. | -| offsetY | Number | 0 | Additional amount of pixel to be added on the content's bounds. E.g. value of 100 will render the content when scrolled within 100px _near_ it. | +| offsetY | Number | 0 | Additional amount of pixel to be added on the content's bounds. E.g. value of 100 will render the content when scrolled within 100px _near_ it. ## Development diff --git a/dev/serve.vue b/dev/serve.vue index cfba649..c888137 100644 --- a/dev/serve.vue +++ b/dev/serve.vue @@ -20,6 +20,9 @@ export default Vue.extend({