From 8dc6c48bb6d130ec8a56c8679d90dd2d48b8b542 Mon Sep 17 00:00:00 2001 From: zhongxingdou Date: Tue, 7 Sep 2021 20:51:26 +0800 Subject: [PATCH 1/4] options add alternate and noActive, install support options --- README.md | 8 +++++--- docs/index.html | 12 ++++++------ src/directive.js | 34 ++++++++++++++++++++++++---------- src/index.js | 3 ++- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index e5e39a0..2f70c18 100755 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ npm i --save-dev vue-scroll-show ```js import VueScrollShow from 'vue-scroll-show' -Vue.use(VueScrollShow) +Vue.use(VueScrollShow, defaultOptions) ``` #### SSR (Nuxt.js) @@ -19,7 +19,7 @@ Vue.use(VueScrollShow) ```js import VueScrollShow from 'vue-scroll-show/dist/ssr.index' -Vue.use(VueScrollShow) +Vue.use(VueScrollShow, defaultOptions) ``` ## Usage @@ -43,7 +43,9 @@ or with options | Option | Description | | ------ | ------ | +| noActive | Add classes if element not in display area | | active | Add classes if element in display area | | delay | Timeout to add classes to element | | offset | Screen offset to add class to element | -| parentId | Id parent element for starting add classes to directive elements | \ No newline at end of file +| parentId | Id parent element for starting add classes to directive elements | +| alternate | If remove active class and add noActive class if element not in display area | \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 768c03a..8e531f2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -54,14 +54,14 @@

Scroll down

- Show three without selector - Show four with offset 500 + Show three without selector + Show four with offset 500
- +