vue2-scrollspy | Scrollspy for Vue2 | Frontend Plugin library
kandi X-RAY | vue2-scrollspy Summary
kandi X-RAY | vue2-scrollspy Summary
Scrollspy for Vue2
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- scroll events handler
- Returns true if argument is used .
- Insert value into object
- Evaluate E .
- Set timeout .
- String - > boolean value
- Check if object is a variable
- Insert a value at end
- return a function
- Swap two types
vue2-scrollspy Key Features
vue2-scrollspy Examples and Code Snippets
Community Discussions
Trending Discussions on vue2-scrollspy
QUESTION
Codesandbox: https://codesandbox.io/s/romantic-pond-ehixi?file=/pages/index.vue
Hi, let me explain the design first before the problem so we all are on the same view 🙂
I am currently new to Vue and working on a Nuxtjs project with the Vuex store.
In my layout/default.vue
, I have a Header
, Footer
component, and between them.
Both
Header
& Footer
will be fixed/sticky in the top and bottom.
The main content will be scrollable and it has cards inside it.
⚙️ Problem:
The Header
component will have navigation which will get highlighted when the correct card is in the viewport (at least 100px offset).
In the Footer
component, there are buttons to navigate the user to previous or next card (100px offset included) depending on what card the user is looking at.
I am using vue2-scrollspy but it's not working (see codesandbox). I am also not sure if this is the right module to do the job.
⚠️ UPDATE 01
Scroll Spy is working now when the user scrolls the page & I added a watcher to update the store values. The remaining issue is to scroll the user to the previous or next card depending on what they are viewing. On vue2-scrollspy
document, it says the following.
ANSWER
Answered 2020-Aug-05 at 07:13Ok so this is how I fix my issue 🙏
On the /pages/index.vue
I added ID on every card and a watcher to check every time scroll spy change count
value. If count
change, I update the value on the store.global [currentView, previousView, nextView].
📄 /pages/index.vue
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue2-scrollspy
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page