import "../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import { fetchImages } from "../../../packages/index.mjs";
import { defineComponent, watch, resolveDirective, withDirectives, openBlock, createElementBlock } from "../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { ref } from "../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
const _hoisted_1 = {
  class: "list-img",
  alt: "图表图片"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const imageInfo = ref("");
    const fetchImageUrl = async () => {
      imageInfo.value = await fetchImages(props.chartConfig);
    };
    watch(
      () => props.chartConfig.key,
      () => fetchImageUrl(),
      {
        immediate: true
      }
    );
    return (_ctx, _cache) => {
      const _directive_lazy = resolveDirective("lazy");
      return withDirectives((openBlock(), createElementBlock("img", _hoisted_1, null, 512)), [
        [_directive_lazy, imageInfo.value]
      ]);
    };
  }
});
export {
  _sfc_main as default
};
