<template>
  <a v-bind:class="[componentClass]" :href="getHref" :title="getTitle">{{getLabel}}</a>
</template>

<script>
import base from './c-base'
const props = {
   dataFieldIdent4Href: {
    type: String,
    default: null
  },
  dataFieldIdent4Label: {
    type: String,
    default: null
  },
  dataFieldIdent4Title: {
    type: String,
    default: null
  },
  label: {
    type: String,
    default: null
  }
}

import stringUtils from '../classes/stringUtils'

export default {
  extends: base,
  data: function () {
    return {
      componentClass: 'c-btnhyp'
    }
  },
  props,
  computed: {
    getHref:function() {
      return this.getDataFieldValue(this.dataFieldIdent4Href)
    },
    getLabel : function() {
      if(stringUtils.isEmpty(this.dataFieldIdent4Label)) {
        return this.label
      }
      return this.getDataFieldValue(this.dataFieldIdent4Label)
    },
    getTitle:function() {
      return this.getDataFieldValue(this.dataFieldIdent4Title)
    }
  }
}</script>
