import { defineComponent, computed, ref, defineAsyncComponent } from 'vue'; import { useStorageStore } from '@/stores/storage'; const ContainerColumn = defineAsyncComponent( () => import("./ContainerColumn") ) const ContainerGrid = defineAsyncComponent( () => import("./ContainerGrid") ) const ContainerView = defineComponent({ name: 'contaner-view', setup(props, ctx) { const storageStore = useStorageStore(); let currentTab = ref('column-view'); const tabs = computed(() => { const cont = storageStore.getStorageContainer; return cont?.grid ? ['column-view', 'grid-view'] : ['column-view']; }); return { currentTab, tabs, storageContainer: computed(() => storageStore.getStorageContainer), }; }, render() { return ( <>
Name: {this.storageContainer?.name}
Layout: {this.storageContainer?.grid ? 'grid' : 'column'} {this.storageContainer?.grid ? ( {this.storageContainer?.rowWise ? 'by-row' : 'by-column'} ) : null}
Slots: {this.storageContainer?.slots}
Empty Slots: {(this.storageContainer?.slots ?? 0) - (this.storageContainer?.samples?.length ?? 0)}
{this.currentTab === 'column-view' ? : null} {this.currentTab === 'grid-view' ? : null}
); }, }); export { ContainerView }; export default ContainerView