import { defineComponent, ref, computed, defineAsyncComponent } from 'vue'; import { useSampleStore } from '@/stores/sample'; import { useSetupStore } from '@/stores/setup'; const StockCategory = defineAsyncComponent( () => import('./StockCategory') ) const StockItem = defineAsyncComponent( () => import('./StockItem') ) const StockUnit = defineAsyncComponent( () => import('./StockUnit') ) const Hazard = defineAsyncComponent( () => import('./Hazard') ) const InventoryHome = defineComponent({ name: 'InventoryHome', setup(props) { const setupStore = useSetupStore(); const sampleStore = useSampleStore(); let currentTab = ref('stock-categories'); const tabs = ['stock-categories', 'hazards', 'stock-units', 'stock-items' ]; let currentTabComponent = computed(() => 'tab-' + currentTab.value); sampleStore.fetchSampleTypes(); setupStore.fetchDepartments({}); return { exposed: { currentTab, tabs } }; }, render() { const { currentTab, tabs } = this.exposed; return (
{currentTab.value === 'stock-items' ? : null} {currentTab.value === 'stock-categories' ? : null} {currentTab.value === 'stock-units' ? : null} {currentTab.value === 'hazards' ? : null}
); }, }); export { InventoryHome }; export default InventoryHome