Added inventory tab
This commit is contained in:
@@ -45,6 +45,9 @@
|
||||
Features
|
||||
</v-tab>
|
||||
<v-tab>
|
||||
Inventory
|
||||
</v-tab>
|
||||
<v-tab>
|
||||
Tree
|
||||
</v-tab>
|
||||
</v-tabs>
|
||||
@@ -57,6 +60,9 @@
|
||||
<v-tab-item>
|
||||
<features-tab :creature-id="creatureId"/>
|
||||
</v-tab-item>
|
||||
<v-tab-item>
|
||||
<inventory-tab :creature-id="creatureId"/>
|
||||
</v-tab-item>
|
||||
<v-tab-item>
|
||||
<tree-tab :creature-id="creatureId"/>
|
||||
</v-tab-item>
|
||||
@@ -74,10 +80,11 @@
|
||||
import isDarkColor from '/imports/ui/utility/isDarkColor.js';
|
||||
import { mapMutations } from "vuex";
|
||||
import { theme } from '/imports/ui/theme.js';
|
||||
import TreeTab from '/imports/ui/creature/character/characterSheetTabs/TreeTab.vue';
|
||||
import StatsTab from '/imports/ui/creature/character/characterSheetTabs/StatsTab.vue';
|
||||
import FeaturesTab from '/imports/ui/creature/character/characterSheetTabs/FeaturesTab.vue';
|
||||
import { recomputeCreature } from '/imports/api/creature/creatureComputation.js'
|
||||
import InventoryTab from '/imports/ui/creature/character/characterSheetTabs/InventoryTab.vue';
|
||||
import TreeTab from '/imports/ui/creature/character/characterSheetTabs/TreeTab.vue';
|
||||
import { recomputeCreature } from '/imports/api/creature/creatureComputation.js';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -85,9 +92,10 @@
|
||||
creatureId: String,
|
||||
},
|
||||
components: {
|
||||
TreeTab,
|
||||
StatsTab,
|
||||
FeaturesTab,
|
||||
InventoryTab,
|
||||
TreeTab,
|
||||
},
|
||||
data(){return {
|
||||
theme,
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<template lang="html">
|
||||
<div class="inventory">
|
||||
<column-layout>
|
||||
<div v-for="container in containers" :key="container._id">
|
||||
<container-card
|
||||
:model="container"
|
||||
:items="container.items"
|
||||
/>
|
||||
</div>
|
||||
</column-layout>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CreatureProperties from '/imports/api/creature/CreatureProperties.js';
|
||||
import ColumnLayout from '/imports/ui/components/ColumnLayout.vue';
|
||||
import ContainerCard from '/imports/ui/properties/components/inventory/ContainerCard.vue';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
creatureId: String,
|
||||
},
|
||||
components: {
|
||||
ColumnLayout,
|
||||
ContainerCard,
|
||||
},
|
||||
meteor: {
|
||||
containers(){
|
||||
return CreatureProperties.find({
|
||||
'ancestors.id': this.creatureId,
|
||||
type: 'container',
|
||||
removed: {$ne: true},
|
||||
}, {
|
||||
sort: {order: 1},
|
||||
}).map(container => {
|
||||
container.items = CreatureProperties.find({
|
||||
'parent.id': container._id,
|
||||
removed: {$ne: true},
|
||||
}, {
|
||||
sort: {order: 1},
|
||||
});
|
||||
return container;
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
</style>
|
||||
Reference in New Issue
Block a user