
<template>
  <div @click="onLinkClick">
    <dof-rich-text-text
      :text-value="linkValue"
      :has-text-margin="hasTextMargin"
      :text-style="linkStyle?linkStyle:defObj"
      :text-theme="linkTheme?linkTheme:'black'"></dof-rich-text-text>
  </div>
</template>

<script>
import DofRichTextText from './dof-rich-text-text.vue';

export default {
  components: { DofRichTextText },
  props: {
    linkValue: {
      type: [String, Number],
      default: ''
    },
    hasTextMargin: {
      type: Boolean,
      default: true
    },
    linkHref: {
      type: String,
      default: ''
    },
    linkTheme: {
      type: String,
      default: 'black'
    },
    linkStyle: {
      type: Object,
      default: () => ({})
    }
  },
  data: () => ({
    defObj: {}
  }),
  methods: {
    onLinkClick (e) {
      const self = this;
      // Utils.goToH5Page(self.linkHref);
      self.$emit('dofRichTextLinkClick', { element: e, href: self.linkHref });
    }
  }
};
</script>
