title: Vue loses prototypes and imported files when creating new component
body: <p>When extending a Vue component to a modal, a new Vue instance is generated. This leads to losing all pre-imported helpers/ Vuex-stores etc.</p>
  
  <p>Is there a way how to copy all data to the new extended Vue component?</p>
  
  <p>To make it clear, have a look at this <a href="https://jsfiddle.net/L9h8cujz/" rel="nofollow noreferrer">jsfiddle</a>.</p>
  
  <p>It confronts you with an alert. When you click on the button, the modal is opened. But if you look at my code, another alert should be fired. But $hi() is not available in the other Vue instance.</p>
  
  <p>I create a component like this: </p>
  
  <pre><code>const createComponent = (props) =&gt; {
      const wrapper = document.createElement('div');
  
      const Component = Vue.extend(MyComponent);
  
      return new Component({
          propsData: {
              props,
          },
      }).$mount(wrapper);
  };
  </code></pre>
  
  <p>I'm using <a href="https://sweetalert.js.org/guides/" rel="nofollow noreferrer">SweetAlert</a> as a modal.</p>
  
  <p>So I add this like:</p>
  
  <pre><code>swal({
      content: createComponent(props).$el,
  })
  </code></pre>