#1276·gridsome

Ability to force page reload on internal link click

Author: tamirvsCreated Jul 18, 2020Updated Aug 31, 2023

Summary

When you press an internal link, the view changes without a page reload. Sometimes it is good to have the ability to reload the whole page instead of clearing the state (using Vuex) and have a "fresh start".
I think that in vue and vue-router, when you give a relative path in the link (e.g. /foobar), it loads only the new component, but when you give a full url (https://www.example.com/foobar) it reloads the page. I'm not sure why it doesn't work the same here.

Basic example

<a href="/foobar">link</a> - replace components <a href="https://www.example.com/foobar">link</a> - a full reload

Motivation

Have the ability to change the page and have a clean state without clearing it manually, even though performance-wise it is less efficient.