Answers for "vue app anchor link to route"

0

how to make @click in router-link vuejs

<router-link @click.native="remove" to="/remove">Remove</router-link>
Posted by: Guest on April-29-2020
0

vue on page link or anchor

//P.S. the code is written for Vue 2.
//You will have to adjust it to Vue 1.

//Your view:
// <a class="porto-button" @click="scrollMeTo('porto')">Porto, Portugal</a>
// ...
// <div ref="porto" class="fl-porto"> </div>




//Your code:
methods: {
  scrollMeTo(refName) {
    var element = this.$refs[refName];
    var top = element.offsetTop;

    window.scrollTo(0, top);
  }
}
Posted by: Guest on June-01-2021

Browse Popular Code Answers by Language