layout-link.vue 754 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) {
      // console.log(newVal);
    },
  },
  // activated() {
  //   console.log(this.report);
  //   console.log("this.report");
  // },
  methods: {
    jumpTo() {
      this.$store.dispatch('reportYas', {
        params: {
          appop: this.reportEvent,
          param:this.report
        }
      });

      if (!this.href) {
        return;
      }

      this.$xianyu.goXianyuNewPage({
        url: this.href
      });
    }
  }
};
</script>