title: Navigating with nuxt-link to anchor/hash on a different page is not working
body: <p>I want to navigate to a specific section of a page from another page. So I added the scrollBehavior function in router object in nuxt.config.js file like this:</p>
  <pre class="lang-js prettyprint-override"><code>router: {
      scrollBehavior(to) {
        if (to.hash) {
          return {
            selector: to.hash,
            behavior: &quot;smooth&quot;
          };
        }
      }
    }
  </code></pre>
  <p>My 'pages' directory tree is like this:</p>
  <pre><code>pages/
     index.vue
     parent.vue
     random.vue
  </code></pre>
  <p>In default.vue of 'layouts' directory I wrote the navbar:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;button @click=&quot;$router.push({ name: 'parent' })&quot;&gt;Parent One&lt;/button&gt;
  &lt;button @click=&quot;$router.push({ name: 'parent', hash: '#sec2' })&quot;&gt;Parent Two&lt;/button&gt;
  </code></pre>
  <p>Inside parent.vue I have two sections:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;sec-1&quot; id=&quot;sec1&quot;&gt;
        &lt;h1&gt;Parent One&lt;/h1&gt;
        &lt;p&gt;...
        &lt;/p&gt;
  &lt;/div&gt;
  &lt;div class=&quot;sec-2&quot; id=&quot;sec2&quot;&gt;
        &lt;h1&gt;Parent Two&lt;/h1&gt;
        &lt;p&gt;...
        &lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Now, The problem is When I click the 'parent two' button from random.vue file it doesn't work. but when I am in parent.vue file and click the button it scrolls to the second section. But I want to navigate to the second section from random.vue page. If I write the exact code in a vue project then it works fine but doesn't work in nuxt project. But I need to do it in my Nuxt project.</p>