"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
require("../../../../../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.js");
const runtimeCore_esmBundler = require("../../../../../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js");
const reactivity_esmBundler = require("../../../../../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js");
const shared_esmBundler = require("../../../../../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.js");
const _hoisted_1 = /* @__PURE__ */ runtimeCore_esmBundler.createElementVNode("thead", null, [
  /* @__PURE__ */ runtimeCore_esmBundler.createElementVNode("tr", null, [
    /* @__PURE__ */ runtimeCore_esmBundler.createElementVNode("th", null, "key"),
    /* @__PURE__ */ runtimeCore_esmBundler.createElementVNode("th", null, "value")
  ])
], -1);
const _sfc_main = /* @__PURE__ */ runtimeCore_esmBundler.defineComponent({
  __name: "displayTable",
  props: {
    target: Object
  },
  setup(__props) {
    const props = __props;
    const defaultItem = {
      key: "",
      value: ""
    };
    const tableArray = reactivity_esmBundler.reactive({ content: [] });
    runtimeCore_esmBundler.watch(
      () => props.target,
      (target) => {
        tableArray.content = [];
        for (const k in target) {
          tableArray.content.push({
            key: k,
            value: target[k]
          });
        }
        if (!tableArray.content.length)
          tableArray.content = [JSON.parse(JSON.stringify(defaultItem))];
      },
      {
        immediate: true,
        deep: true
      }
    );
    return (_ctx, _cache) => {
      const _component_n_table = runtimeCore_esmBundler.resolveComponent("n-table");
      return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(_component_n_table, {
        bordered: false,
        "single-line": false,
        size: "small",
        style: { "border-bottom-right-radius": "7px", "border-bottom-left-radius": "7px" }
      }, {
        default: runtimeCore_esmBundler.withCtx(() => [
          _hoisted_1,
          runtimeCore_esmBundler.createElementVNode("tbody", null, [
            (runtimeCore_esmBundler.openBlock(true), runtimeCore_esmBundler.createElementBlock(runtimeCore_esmBundler.Fragment, null, runtimeCore_esmBundler.renderList(tableArray.content, (item, index) => {
              return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock("tr", { key: index }, [
                runtimeCore_esmBundler.createElementVNode("td", null, shared_esmBundler.toDisplayString(item.key || "暂无"), 1),
                runtimeCore_esmBundler.createElementVNode("td", null, shared_esmBundler.toDisplayString(item.value || "暂无"), 1)
              ]);
            }), 128))
          ])
        ]),
        _: 1
      });
    };
  }
});
exports.default = _sfc_main;
