Skip to content

Commit

Permalink
scoped context to pass the item
Browse files Browse the repository at this point in the history
  • Loading branch information
negue committed May 20, 2017
1 parent 9afb2b1 commit be77551
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions website/client/components/inventory/equipment.vue
Expand Up @@ -30,7 +30,7 @@
b-dropdown-item(@click="groupBy = 'class'", :class="{'dropdown-item-active': groupBy === 'class'}") {{ $t('class') }}

drawer(
:title="$t('equipment')",
:title="$t('equipment')",
:errorMessage="(costume && !user.preferences.costume) ? $t('costumeDisabled') : null",
)
div(slot="drawer-header")
Expand Down Expand Up @@ -72,8 +72,11 @@
:starVisible="!costume || user.preferences.costume",
@click="equip",
)
div(slot="itemContent", :class="'shop_' + flatGear[activeItems[group]].key")
equipmentAttributesPopover(:item="flatGear[activeItems[group]]", slot="popoverContent")
template(slot="itemContent", scope="ctx")
div(:class="'shop_' + ctx.item.key")
template(slot="popoverContent", scope="ctx")
equipmentAttributesPopover(:item="ctx.item")

div(
v-for="group in itemsGroups",
v-if="viewOptions[group.key].selected",
Expand All @@ -96,7 +99,8 @@
@click="equip",
)
div(slot="itemContent", :class="'shop_' + item.key")
equipmentAttributesPopover(:item="item", slot="popoverContent")
template(slot="popoverContent", scope="ctx")
equipmentAttributesPopover(:item="ctx.item")
div(v-if="items[group.key].length === 0")
p(v-once) {{ $t('noGearItemsOfType', { type: $t(group.label) }) }}
a.btn.btn-show-more(
Expand Down
4 changes: 2 additions & 2 deletions website/client/components/inventory/item.vue
Expand Up @@ -5,7 +5,7 @@ b-popover(
v-if="showPopover",
)
span(slot="content")
slot(name="popoverContent")
slot(name="popoverContent", :item="item")

.item-wrapper
.item
Expand All @@ -15,7 +15,7 @@ b-popover(
v-if="starVisible"
) ★
span.item-content
slot(name="itemContent")
slot(name="itemContent", :item="item")
span.item-label(v-if="label") {{ label }}
div(v-else)
.item-wrapper
Expand Down

0 comments on commit be77551

Please sign in to comment.