import { queryTransaction } from "ycc-api/dist/cmjs/service/blockDetail/index";
import Vue from "vue";

export default Vue.extend({
  data() {
    return {
      searchValue: "",
      data: {} as any,
      loading: false,
    };
  },

  mounted() {
    this.init();
  },
  activated() {
    this.init();
  },
  computed: {
  },
  methods: {
    clickSearch(str: string) {
      console.log(str);
    },
    setSearchValue(v: string) {
      this.searchValue = v;
    },
    async init() {
      this.loading = true;
      const ret = await queryTransaction(
        "ycc",
        "/yccApi",
        this.$route.query.hash as string
      );
      this.loading = false;
      if (ret) {
        this.data = ret;
      }
    },
  },
});
