Answer the question
In order to leave comments, you need to log in
vue.js. links with href="#anchor", how to make them work?
Project on vue-cli2, connected vue-router
links come in the content from the server, upon request, for example a href="#block1"...
when you click on them, instead of scrolling to the desired block, the page is reloaded
- how to make the standard ones work anchors in normal links?
- how to form a router-link from ordinary links so that there is no page reload on click?
Answer the question
In order to leave comments, you need to log in
the simplest solution I found is to hang @click on the container into which the content is loaded by Ajax,
in this function, native js look at e.target, determine that this is a link, its hash, and twist to the desired block
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question