Component({
  options: { multipleSlots: true },
  /**
   * 组件的属性列表
   */
  properties: {
    active: {
      type: String,
      value: "",
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    list: [
      { value: "index", label: "首页", icon: "home" },
      { value: "scan", label: "扫码", icon: "scan" },
      { value: "my", label: "我的", icon: "user" },
    ],
    pages: {
      index: "/pages/index/index",
      scan: "/pages/processEntry/processEntry",
      my: "/pages/my/my",
    } as Record<string, string>,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onChange(e: any) {
      if (e.detail.value != this.data.active) {
        wx.reLaunch({ url: this.data.pages[e.detail.value] });
      }
    },
  },
});

