I am referring to the Bootstrap Vue Scrollspy(https://bootstrap-vue.org/docs/directives/scrollspy/#scrollspy). I am using Nuxt js.
My elements are referenced correctly and are spying on the content. I would like to get the element/section that is currently being viewed to be updated in a div. I know that an active class is added to the element/section being viewed, but I am not sure how to get it.
This is what I have:
<div id="mobilescrollspy"> <--- Scrollspy headings in a dropdown
<b-nav v-b-scrollspy>
<b-nav-item-dropdown text="Dropdown">
<b-dropdown-item class="text-base self-center" href="#item-1">
Item 1 Heading
</b-dropdown-item>
<b-dropdown-item class="text-base self-center" href="#item-2">
Item 2 Heading
</b-dropdown-item>
<b-dropdown-item class="text-base self-center" href="#item-3">
Item 3 Heading
</b-dropdown-item>
</b-nav-item-dropdown>
</b-nav>
</div>
<div class="content"> <--- The content itself
<div id="item-1">
This is the content for item 1
</div>
<div id="item-2">
This is the content for item 2
</div>
<div id="item-3">
This is the content for item 3
</div>
</div>
If item 2 is in view, I want a text that shows: "Item 2 Heading", once I scroll to item 3, this div gets updated to "Item 2 Heading". How can I achieve this? Thanks for the help!