<template>
  <a :href="_href" :target="_target" :class="_class" v-if="_class!=''">
      <slot />
  </a>
  <a :href="_href" :target="_target" v-else>
      <slot />
  </a>
</template>

<script lang="ts">
import Vue from 'vue';

export default Vue.extend({
  name: 'A',
  props: {
    href: {
      type: String,
      required: true
    },
    target: {
      type: String,
    },
    classe: {
      type: String,
    }
  },
  computed: {
    _href (): string {
      return this.href
    },
    _target (): string {
      return this.target
    },
    _class (): string {
        if (this.classe === undefined || this.classe === null) {
          return ""
        } else {
          return this.classe
        }
    }
  }
})
</script>