title: How to scroll to the element using scrollBehavior and hash in Vue
body: <p>I have page with a lot of components and I like to scroll to the point during opening the page.
  In <code>mounted</code> I have method which is pushing hash to the routes.
  the page:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;template&gt;
  &lt;section&gt;
     &lt;ComponentA /&gt;
     &lt;ComponentB /&gt;
     &lt;ComponentC /&gt;
     &lt;div id="#scrollHere"&gt;
         &lt;ComponentD /&gt;
     &lt;/div&gt;
     &lt;ComponentE /&gt;
     &lt;ComponentF /&gt;
  &lt;/section&gt;
  &lt;/template&gt;
  &lt;script&gt;
  ...
  mounted() {
          this.$router.push({name: 'pageName', hash: '#scrollHere'});
      }
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>router.js</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>const router = new VueRouter({
    routes,
    mode: "history",
    scrollBehavior(to) {
      if (to.hash) {
        return {
          selector: to.hash
        };
      }
    }
  });
  </code></pre>
  
  <p>During opening the page nothing happen. Do you have any advices?</p>
  
  <p><strong><em>EDIT</em></strong>
  I resolved the issue. 
  1. As said <em>@Delena Malan</em> (thanks!), removal <code>#</code> from <code>div id="#scrollHere"</code> was necessary.
  2. I set Promise with timeOut in scrollBehaviour. The problem was in scrollBehavior my div didn't exist, so it was imposibble to scroll. </p>
  
  <p><strong>router.js</strong></p>
  
  <pre><code>const scrollBehavior = to =&gt; {
    if (to.hash) {
      return new Promise(resolve =&gt; {
        setTimeout(() =&gt; {
          resolve({ selector: to.hash });
        }, 1000);
      });
    }
  };
  </code></pre>