question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to bind v-scroll-to to a generated id?

See original GitHub issue

You may not understand what I mean, let me show you the code: I have an array Anc[‘1’, ‘2’, ‘3’, ‘4’] and 4 div whose id is 1-4 now this is what I do

<a
     v-for='(item, index) in titleInfo'
     href='#'
     :v-scroll-to="'#' + Anc[index]"
     @click='showArticle(index)'
     >
     {{ titleInfo[index] }}
   </a>

but unfortunately it doesn’t work but no error shows in console.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
jondujakacommented, Feb 2, 2019

For me it works if i pass the element through the options object v-scroll-to="{ el: '#' + Anc[index] }"

1reaction
rohan220217commented, Aug 2, 2020

Just make sure you don’t use v-bind or : here

  <v-list-item-content  v-scroll-to="item.ids">
       <v-list-item-title v-text="item.title"></v-list-item-title>
 </v-list-item-content>
 menuItems: [
      { title: "Home", ids: "#home" },
      { title: "About Us", ids: "#about" },
      { title: "Features", ids: "#features" },
      { title: "Pricing", ids: "#pricing" },
      { title: "Contact", ids: "#contact" },
    ],
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to bind a Jquery scroll event to a dynamically added ...
I need to bind a scroll event to this div so that when it reaches the end, an action is fired. $('body'). on('scroll','#searchBarID',...
Read more >
Page scroll to id for WordPress tutorial – malihu | web design
In post visual editor, click the toolbar button “Insert Page scroll to id target” to create a target at the cursor position in...
Read more >
Document: scroll event - Web APIs - MDN Web Docs - Mozilla
The scroll event fires when the document view has been scrolled. To detect when scrolling has completed, see the Document: scrollend event.
Read more >
Table | Page Scrolling | JET Developer Cookbook - Oracle
Construct a MutableArrayDataProvider with an array of data. Use the oj-table tag to create a JET Table; Use the data attribute to bind...
Read more >
APL Commands | Alexa Skills Kit - Amazon Developer
Commands evaluate in their source data-binding context. ... Assign a unique value to the target component with the id property and set componentId...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found