import { App, defineComponent, ref, createVNode, h, render } from 'vue';
// import Too from './Too.vue'

const message = {
  setup() {
    const num = ref(1);
    return {
      num,
    };
  },
  template: `<div>
            <div>{{num}}</div>
            <div>这是一个弹窗</div>
          </div>`,
};

const Test = defineComponent({
  name: 'test',
  props: ['title'],
  setup(props) {
    const vm = createVNode(message)
    const container = document.createElement('div')
    render(vm, container)
    return () => container.firstElementChild; // 渲染正常
  },
});

Test.install = (app: App) => {
  app.component(Test.name, Test);
};

export default Test;
