title: Vue 3 extends vue.js components from third party library in defineComponent
body: <p>I want to use third party library element-plus in my component. In <code>setup</code> <code>defineComponent</code> entends that component. In console, it would warn <code>Failed to resolve component: el-radio  at &lt;App&gt;</code></p>
  <p>In about router, Here is the about.vue</p>
  <pre><code>&lt;template&gt;
    &lt;div id=&quot;popup-content&quot;&gt;&lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import {
    onMounted, createApp, defineComponent, nextTick,
  } from 'vue';
  import Test from '@/components/Test.vue';
  
  export default {
    setup() {
      onMounted(() =&gt; {
        const myNewComponent = defineComponent({
          extends: Test,
        });
        createApp(myNewComponent).mount('#popup-content');
        nextTick(() =&gt; {
          createApp(myNewComponent).mount('#popup-content');
        });
      });
    },
  }
  </code></pre>
  <p>Test component has used element-plus <code>el-raido</code> component, Test.vue</p>
  <pre><code>&lt;template&gt;
    &lt;el-radio v-model=&quot;radio&quot; label=&quot;1&quot;&gt;备选项&lt;/el-radio&gt;
    &lt;el-radio v-model=&quot;radio&quot; label=&quot;2&quot;&gt;备选项&lt;/el-radio&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  export default {
    data() {
      return {
        radio: '1',
      };
    },
  };
  &lt;/script&gt;
  </code></pre>
  <p>I have add element-plus, and register all in main.js</p>
  <pre><code>import { createApp } from 'vue';
  import ElementPlus from 'element-plus';
  import 'element-plus/lib/theme-chalk/index.css';
  import App from './App.vue';
  
  const app = createApp(App);
  
  
  app.use(ElementPlus);
  app.mount('#app');
  </code></pre>
  <p><a href="https://i.stack.imgur.com/OBnLh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OBnLh.png" alt="enter image description here" /></a></p>
  <p>I have found this question
  <a href="https://stackoverflow.com/questions/42049367/extend-vue-js-component-from-third-party-library">Extend vue.js component from third-party library</a></p>