<template>
  <span>{{ warehouseName }}</span>
</template>

<script>
export default {
  name: 'WarehouseName',
  props: {
    stockCode: {
      type: String,
      default: ''
    }
  },
  computed: {
    warehouseName() {
      const stock = this.$store.getters.warehouseData[this.stockCode] || {};
      return stock.stockName;
    }
  },
  created() {
    this.$store.dispatch('warehouse/getWarehouse', {})
  }
}
</script>

<style>

</style>