makes adding loot working
This commit is contained in:
@@ -1,37 +1,33 @@
|
||||
<template>
|
||||
<div>
|
||||
<p class="heading has-text-left is-size-5">
|
||||
Nouveau loot - {{ looted.length }} objet(s)</p>
|
||||
<ItemInput @addItem="onAddItem" :source="inventory"></ItemInput>
|
||||
<p v-for="(item, idx) in looted" :key="idx"
|
||||
class="has-text-left is-size-5">
|
||||
{{ item.name }} ({{ item.sell_value }}po)
|
||||
</p>
|
||||
<div class="box">
|
||||
<ItemInput
|
||||
@addItem="onAddItem"
|
||||
:source="inventory"
|
||||
></ItemInput>
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label"><label class="label">ou</label></div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<button class="button is-primary">Depuis une liste</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="button is-danger" @click="$emit('confirmAction')">Finaliser</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ItemInput from './ItemInput.vue'
|
||||
// List of items for autocomplete
|
||||
const MOCK_ITEMS = [
|
||||
{id: 35, name: "Cape d'invisibilité", sell_value: 30000},
|
||||
{id: 8, name: "Arc long", sell_value: 10},
|
||||
{id: 9, name: "Arc court", sell_value: 10},
|
||||
];
|
||||
|
||||
|
||||
export default {
|
||||
props: ["inventory"],
|
||||
components: { ItemInput },
|
||||
data () { return {
|
||||
looted: [],
|
||||
inventory: MOCK_ITEMS,
|
||||
};
|
||||
},
|
||||
data () { return {}; },
|
||||
methods: {
|
||||
onAddItem (item) {
|
||||
this.looted.push(item);
|
||||
},
|
||||
onClose () {
|
||||
this.$emit('done');
|
||||
this.$emit('addItem', item);
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user