title: Only scroll to top of page on certain pages of my Vue.js router - keep scroll position same on other
body: <p>On the homepage, I would like to navigate to one of my pages in a new Vue (transitioned) view. 
  The user, upon 'closing' this page ends up back to last scrolled position.</p>
  
  <p>That works by adding the Vue native scrollBehavior to the VueRouter.</p>
  
  <p>This is what I've got going there: </p>
  
  <pre><code>const router = new VueRouter({
  scrollBehavior: (to, from, savedPosition) =&gt; new Promise((resolve) =&gt; {
      const position = savedPosition || {};
      if (!savedPosition) {
        if (to.hash) {
          position.selector = to.hash;
        }
        if (to.matched.some((m) =&gt; m.meta.scrollToTop)) {
          position.x = 0;
          position.y = 0;
        }
      }
      router.app.$root.$once('triggerScroll', () =&gt; {
        router.app.$nextTick(() =&gt; resolve(position));
      });
    }),
  routes, 
  []
  </code></pre>
  
  <p><strong>However!</strong> That means that scrolling down on the homepage, would result in ending up at the same scroll position on the new page.</p>
  
  <p>I would like to prevent that. That the new page opens at <code>y = 0</code>. But! Without resetting the previous scroll position on the homepage. </p>
  
  <p>So when the back button is clicked, it sends the user back to the scroll position of the element clicked on the homepage.</p>
  
  <p>Any idea how I can pull this off?</p>