title: Moving Vue components around inside the dom?
body: <p>I am moving Vue components up in the dom if I am on mobile since I want to use positioning absolute and want to make sure I am not within a <code>relative</code> container.</p>
  
  <pre><code>if (this.mobile) {
      this.$el.parentNode.removeChild(this.$el);
      document.getElementById('vue').appendChild(this.$el);
  } else {
      // Place the element back at it's original location.
  }
  </code></pre>
  
  <p>This code is placed with a debounced <code>resize</code> method so it also works on resizing of the window.</p>
  
  <p>It works fine but when I start out on mobile and resize back to desktop I need to get the original dom location of where the component was first initialized.</p>
  
  <p>This might be a Javascript only question but how can I get the original location of the exact dom position of this component so I can place it back again?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I am saving the initial parent element with:</p>
  
  <pre><code>this.parent = this.$el.parentElement;
  </code></pre>
  
  <p>This does not guarantee the right order in the parent element though when I append the element back to the parentElement again.</p>