全网没人会回答的问题

如何动态用代码创建组件再插入到模板里.
或者做到能createElement(“VUE-component”)

10天了VUE3 果然没有可以new一个组件的方法

这样的?

<!DOCTYPE html>

<html lang="en">

  <head>

    <meta charset="UTF-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Document</title>

  </head>

  <body>

    <div id="app"></div>

  </body>

  <script type="module">

    import Vue from "https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.esm.browser.js";

    var app = new Vue({

      el: "#app"

    });

    eval(

      `var Cpt1 = Vue.component("counter",{template: '<div> <div>{{ count }}</div><div @click="minus()">-</div><div @click="plus()">+</div></div>',data() {return {count: 0};},methods: {minus() {this.count--;},plus() {this.count++;}} });const instance = new Cpt1();instance.$mount();document.body.appendChild(instance.$el);`

    );

  </script>

</html>