Fix hash anchors scroll
This commit is contained in:
parent
4da6ff8a0e
commit
bb848e2e00
4 changed files with 8 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="contact home-section">
|
<div id="contact" class="contact home-section">
|
||||||
<h2 class="contact__title">Kontakt</h2>
|
<h2 class="contact__title">Kontakt</h2>
|
||||||
<form class="contact__form" action="https://formspree.io/xdonynaz" method="POST">
|
<form class="contact__form" action="https://formspree.io/xdonynaz" method="POST">
|
||||||
<label for="contact__form-email" class="contact__form-label">Twój adres email:</label>
|
<label for="contact__form-email" class="contact__form-label">Twój adres email:</label>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="features-table-section home-section">
|
<div id="features-table" class="features-table-section home-section">
|
||||||
<h2 class="features-table-section__title">Porównanie funkcji</h2>
|
<h2 class="features-table-section__title">Porównanie funkcji</h2>
|
||||||
<div class="features-table">
|
<div class="features-table">
|
||||||
<table class="features-table__table">
|
<table class="features-table__table">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="main home-section">
|
<div id="main" class="main home-section">
|
||||||
<home-main-header />
|
<home-main-header />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -6,5 +6,10 @@ Vue.use(Router);
|
||||||
|
|
||||||
export default new Router({
|
export default new Router({
|
||||||
mode: 'history',
|
mode: 'history',
|
||||||
|
scrollBehavior(to, from, savedPosition) {
|
||||||
|
if (to.hash) return { selector: to.hash };
|
||||||
|
if (savedPosition) return savedPosition;
|
||||||
|
return null;
|
||||||
|
},
|
||||||
routes,
|
routes,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue