"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const vue3sfc = require("./vue3sfc.js");
;/* empty css                */
const _pluginVue_exportHelper = require("../../../../../_virtual/_plugin-vue_export-helper.js");
const _hoisted_1 = { class: "vue-render-container" };
const _sfc_main = {
  __name: "VueRender",
  props: {
    code: { type: String, default: "" },
    params: { type: Object, default: {} }
  },
  setup(__props) {
    const props = __props;
    const dynamicComponent = Vue.ref(null);
    Vue.watch(
      () => props.code,
      async (val) => {
        if (!val) return;
        try {
          dynamicComponent.value = await vue3sfc.loadVueComponent(val);
        } catch (e) {
          console.error("渲染失败", e);
        }
      },
      { immediate: true }
    );
    return (_ctx, _cache) => {
      return Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [
        (Vue.openBlock(), Vue.createBlock(Vue.resolveDynamicComponent(dynamicComponent.value), Vue.normalizeProps(Vue.guardReactiveProps(__props.params)), null, 16))
      ]);
    };
  }
};
const VueRender = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-91bc8b03"]]);
exports.default = VueRender;
