import Vue from "vue";
import QRCode from "qrcode";
export default Vue.extend({
  data() {
    return {};
  },
  mounted() {
    this.init();
  },
  activated() {
    this.init();
  },
  computed: {
    tradeInTotalList() {
      return [
        {
          name: this.$t("lang.address.totalReception"),
          value: "100YCC",
        },
        {
          name: this.$t("lang.address.totalSent"),
          value: "100YCC",
        },
        {
          name: this.$t("lang.block.txCount"),
          value: "100YCC",
        },
        {
          name: this.$t("lang.address.totalValue"),
          value: "100YCC",
        },
      ];
    },
  },
  methods: {
    init() {
      QRCode.toCanvas(
        document.getElementById("qrcode"),
        this.$route.query.address as string,
        {
          color: {
            dark: "#1F3470",
            light: "#0000",
          },
          width: 130,
          margin: 0,
        },
        function(error) {
          if (error) console.error(error);
        }
      );
    },
  },
});
