<template>
  <div id="app">
    <shop-home option="table" :config="config" :shopList="shopList">

    </shop-home>
  </div>
</template>
<script>
import { shopHome } from "../src/index.js";
import {
  decState as shopState,
  decAxios as shopAxios,
}  from "../src/api/config.js";
export default {
  name: "App",
  components: {
    shopHome,
  },
  data() {
    return {
      shopList: [],
      config: {
        decState: shopState,
        decAxios: {
          ...shopAxios,
          // 装修组件中的图片代理
          decImgDomain: function (url, staticImg = "goods.png") {
            const $decStaticImgUrl =
              "https://tikcos.oss-cn-beijing.aliyuncs.com/decOnlineImg/";
            if (url) {
              return url;
            } else {
              return $decStaticImgUrl + staticImg;
            }
          },
          //事件处理器
          decEventHandler: function (e, arg, callback) {
            // 模拟点击事件的响应
            if (callback && typeof callback === "function") {
              callback({ code: 200 });
            }
          },
        },
      },
    };
  },
  created() {
    // 初始化店铺列表（如果需要）
    this.shopList = [
      { value: "1", label: "测试店铺1" },
      { value: "2", label: "测试店铺2" },
    ];
  },
};
</script>
