<template>
  <button type="button" class="btn btn-primary" @click.stop="testRedirect">
    Test redirect
  </button>
</template>
<script>
  import {redirectStore} from '../../tools/redirect-store.js';

  export default{
    props: {
      item: {
        type: Object
      }
    },
    methods: {
      testRedirect() {
        const path = this.item['$item'].from;
        redirectStore.getAbsoluteUrlForOriginPath(path).then(url => {
          window.open(url);
        });
      }
    }
  }
</script>
