
<template>
  <div>
    <!-- eslint-disable vue/require-component-is-->
    <!-- <a v-if="isExter" :href="to.path" target="_blank" rel="noopener">
    <slot />
  </a> -->

    <router-link v-if="!isOpenNewTab" :to="to">
      <slot />
    </router-link>
    <div v-else>
      <slot />
    </div>
  </div>
</template>

<script>

export default {
  props: {
    to: {
      type: Object,
      required: true
    }
  },
  data() {
    const isExter = this.to.isExternal
    const openWay = this.to.openWay
    let isOpenNewTab = false
    if (openWay && openWay === 'NEW_PAGE_OPEN') {
      isOpenNewTab = true
    }
    return {
      isExter,
      isOpenNewTab
    }
  }
}
</script>
