// import { mapGetters } from "vuex";
export default {
  name: 'v-base',
  props: {
    options: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  methods: {
    click(link) {
      /* let isLink = ['string', 'number'].indexOf(typeof link) == -1;
      if(!isLink || !link || link=="0" ) return;
      const event = link;
      link = this.options.link;
      if(link) {
        event.stopPropagation();
      }
      if(!link || link =="0") return; */

      let event;
      if (!['string', 'number'].includes(typeof link)) {
        event = link;
        link = this.options.link;
      }

      if (!link || link === '0') return;
      event?.stopPropagation();

      this.$router.push({
        name: 'page',
        params: {
          id: link,
        },
      });
    },
    getComponent(node, def) {
      return node.type ? `v-${node.type}` : def ? `v-${def}` : 'div';
    },
  },
};
