import { defineComponent, computed, openBlock, createBlock, unref, normalizeStyle } from "vue";
import { NImage } from "naive-ui";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "refConfig_img",
  props: {
    config: {
      type: Object,
      required: true
    },
    showImg: {
      type: Boolean,
      default: () => true
    }
  },
  setup(__props) {
    const props = __props;
    let style = computed(() => {
      let a = props.config;
      if (a) {
        return {
          position: "relative",
          left: (a == null ? void 0 : a.positionLeft) ? (a == null ? void 0 : a.positionLeft) + "px" : null,
          top: (a == null ? void 0 : a.positionTop) ? (a == null ? void 0 : a.positionTop) + "px" : null,
          width: a.width ? a.width + "px" : "auto",
          height: a.height ? a.height + "px" : "auto"
        };
      } else {
        return {};
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(NImage), {
        style: normalizeStyle({ ...unref(style) }),
        "preview-disabled": "",
        src: __props.config.imgSrc,
        width: __props.config.width,
        height: __props.config.height
      }, null, 8, ["style", "src", "width", "height"]);
    };
  }
});
export { _sfc_main as default };
