Answers for "href link onclick javascript vuejs"

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
1

vue on page link or anchor

// scroll to element using quasar library

// uses example; scrollToElement(this.$route.hash)
// uses example; scrollToElement('#cafe-menu')


import { scroll } from 'quasar'
const { getScrollTarget, setScrollPosition } = scroll

    scrollToElement (id) {
      if (id && id !== '') {
        let el = document.querySelector(id)
        if (el) {
          const target = getScrollTarget(el)
          const offset = el.offsetTop
          const duration = 1000
          setScrollPosition(target, offset, duration)
        }
      }
    },
Posted by: Guest on June-01-2021

Browse Popular Code Answers by Language