Files
habitica/website/client/components/inventory/equipment/attributesPopover.vue
T
negue 76c3e51660 sep 25 fixes (#9075)
* on class change: remove owned gear from pinned items

* move dragging item-info closer to the cursor (food / hatching potion)

* remove v-once at attributesPopover (if the parent component is recycled the old data stays active)

* prevent popover to show data of an item that was removed - but the popover stays opened
2017-09-27 21:07:42 +02:00

40 lines
905 B
Vue

<template lang="pug">
div
h4.popover-content-title {{ itemText }}
.popover-content-text {{ itemNotes }}
.popover-content-attr(v-for="attr in ATTRIBUTES", :key="attr")
span.popover-content-attr-key {{ `${$t(attr)}: ` }}
span.popover-content-attr-val {{ `+${item[attr]}` }}
</template>
<script>
import { mapState } from 'client/libs/store';
export default {
props: {
item: {
type: Object,
},
},
computed: {
...mapState({
ATTRIBUTES: 'constants.ATTRIBUTES',
}),
itemText () {
if (this.item.text instanceof Function) {
return this.item.text();
} else {
return this.item.text;
}
},
itemNotes () {
if (this.item.notes instanceof Function) {
return this.item.notes();
} else {
return this.item.notes;
}
},
},
};
</script>