<script>
export default {
  props: {
    navItem: {
      type: Object,
      required: true
    },

    defaultActive: {
      required: true
    },

    collapse: {
      type: Boolean
    },

    iconKey: {
      type: String
    }
  },

  computed: {
    isActive() {
      return this.defaultActive && this.defaultActive.allCode && this.defaultActive.allCode.includes(this.navItem.code);
    }
  },

  methods: {
    clickMenuItem(item) {
      this.$emit('clickMenuItem', item);
    },

    tabMenuHandler(navItem) {
      return !!(navItem.children && navItem.children.length) && navItem.specialShow !== '1';
    }
  }
};
</script>
