<template>
  <div :style="wrapperStyle">
    <slot name="catlog" />
  </div>
</template>

<style lang="scss"></style>

<script>
import withEvents from "../../../lib/withEvents";

export default {
  name: "IgserverCatlog",
  mixins: [withEvents],
  components: {},

  provide() {
    const self = this;
    return {
      get protocol() {
        // 提供给子组件或者插槽
        return self.protocol;
      },
      get ip() {
        // 提供给子组件或者插槽
        return self.document.ip;
      },
      get port() {
        // 提供给子组件或者插槽
        return self.document.port;
      }
    };
  },

  props: {
    // mapbox drawer options
    wrapperStyle: {
      type: Object,
      default: () => {}
    },
    protocol: {
      type: String,
      default: "http"
    },
    ip: {
      type: String,
      default: "localhost"
    },
    port: {
      type: Number,
      default: 6163
    }
  },

  data() {
    return {
      initial: true
    };
  },

  watch: {
    draggable() {}
  },

  mounted() {},

  beforeDestroy() {},

  methods: {
    $_addMCatlog() {
      this.$_emitEvent("added", { catlog: this.catlog });
    },

    remove() {
      this.$_emitEvent("removed");
    }
  }
};
</script>
