title: VueJS Components using scrollIntoView()
body: <p>I'm trying to use a Jump-To-Div kind of feature using document.getElementById().scrollIntoView() in a vue component.</p>
  
  <p>The feature works fine if I call the function when I'm in the component. But if I try to call the function from the parent component using a ref, the element is not scrolled into view.</p>
  
  <p>The parent component is a page and the children components are tabs in the page.</p>
  
  <p>This is the child Vue Component <strong>in the parent component</strong> :-</p>
  
  <pre><code>&lt;el-tab-pane label="Solution Details" name="Solution Details" v-loading="loading"&gt;
                  &lt;solution-details
                      :formData="response"
                      ref="solutionDetails"
                      @done="$emit('done')"&gt;
                  &lt;/solution-details&gt;
              &lt;/el-tab-pane&gt;
  </code></pre>
  
  <p>So there is a SolutionDetails.Vue child component which has a ref="solutionDetails".
  I am calling this method <strong>in the parent component</strong> using the ref for the child component:</p>
  
  <pre><code>handleClick(command) {
              this.activeTab = 'Solution Details';
              this.$refs.solutionDetails.showCurrent(command);
          },
  </code></pre>
  
  <p>There is a showCurrent function in the child component which should get executed for a argument "command". This is that function <strong>in the child component</strong>.</p>
  
  <pre><code>methods: {
          showCurrent(index) {
              document.getElementById(index).scrollIntoView();
          },
  </code></pre>
  
  <p>As you can see, showCurrent should get the element in the page and should scroll into view. If SolutionDetails.vue is the active tab, then the corresponding element is being scrolled into view perfectly fine. But I'm executing the parent function from some other tab, then the <code>this.activeTab = 'Solution Details';</code> is executing, ie. the active tab is changing to SolutionDetails.vue but the requested element is not scrolled into view.</p>
  
  <p>What should I do to scroll to a element when some other tab is the activeTab?</p>