<template>
  <span @click="reportClick">
    <slot></slot>
  </span>
</template>

<script>
import config from "../../config";
export default {
  name: "ReportBtn",
  props: {
    params: Object,
  },
  methods: {
    reportClick() {
      const { version = "" } = config.comOptions;
      try {
        window.$YdGlobal.staticReport({
          releaseVersion: version,
          resourceType: "button",
          platform: "web",
          params: "",
          ...config.comOption,
          ...this.params,
        });
      } catch (err) {
        console.log("埋点失败");
        console.log(err);
      }
    },
  },
};
</script>

<style></style>
