layout-link.vue 679 Bytes
<template>
  <a href="javascript:;" class="layout-link" @click="jumpTo">
    <slot></slot>
  </a>
</template>

<script>
export default {
  name: 'LayoutLink',
  props: {
    href: String,
    report: {
      type: Object,
    },
    reportEvent: String,
  },
  watch: {
    report: function(newVal) {
    },
  },
  methods: {
    jumpTo() {

      if (!this.href) {
        return;
      }

      this.$xianyu.goXianyuNewPage({
        url: this.href
      });

      if (this.reportEvent) {
        this.$store.dispatch('reportYas', {
          params: {
            appop: this.reportEvent,
            param: this.report
          }
        });
      }
    }
  }
};
</script>