import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, unref, renderSlot } from "vue";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "refConfig_bgImg",
  props: {
    config: {
      type: Object,
      required: true
    },
    showImg: {
      type: Boolean,
      default: () => true
    }
  },
  setup(__props) {
    const props = __props;
    let bGstyle = computed(() => {
      let a = props.config;
      let back = "";
      if (a.useBGC) {
        return {
          width: a.width + "px",
          height: a.height + "px",
          background: a.BGC
        };
      } else if (a.imgSrc) {
        back = a.imgSrc;
        return {
          width: `${a.width ? a.width + "px" : "100%"}`,
          height: `${a.height ? a.height + "px" : "100%"}`,
          background: `url(${back})`,
          "background-size": props.showImg ? `${a.width ? a.width + "px" : "100%"} ${a.height ? a.height + "px" : "100%"}` : "0 0",
          "background-repeat": "no-repeat"
        };
      }
      return "";
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        style: normalizeStyle({ ...unref(bGstyle) })
      }, [
        renderSlot(_ctx.$slots, "default")
      ], 4);
    };
  }
});
export { _sfc_main as default };
