<template>
  <b-button
    class="boton border-info my-5"
    type="is-info is-light "
    icon-left="arrow-left-box"
    @click="regresar()"
  >
    Regresar
  </b-button>
</template>

<script>
export default {
  props: {
    path: String,
    deleteFromLocalStorage: Array,
  },
  methods: {
    regresar() {
      if (this.deleteFromLocalStorage) {
        for (let i = 0; i < this.deleteFromLocalStorage.length; i++) {
          localStorage.removeItem(this.deleteFromLocalStorage[i]);
        }
      }
      this.$router.push(this.path);
    },
  },
};
</script>
