Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

scroll to top vue

// add scroll to top when a is clicked (routes)
<a @click="scrollToTop(), goToPricing()">Pricing</a>

 methods: {
        scrollToTop() {
            window.scrollTo(0, 0);
        },  goToPricing() {
            this.$router.push('/pricing');
        }
        }
 
PREVIOUS NEXT
Tagged: #scroll #top #vue
ADD COMMENT
Topic
Name
3+9 =