adds show/hides of loot add card
This commit is contained in:
@@ -1,57 +1,63 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<button v-if="canAdd" class="button is-medium is-info">
|
||||
<button v-if="canAdd"
|
||||
class="button is-medium is-info"
|
||||
@click="is_adding = true"
|
||||
v-show="!is_adding">
|
||||
Nouveau loot
|
||||
</button>
|
||||
<Loot></Loot>
|
||||
<table class="table is-fullwidth is-striped" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Objets de {{ player }}</th>
|
||||
<th v-if="canGrab"></th>
|
||||
<th v-if="canSell">
|
||||
<div class="buttons is-right">
|
||||
<button class="button"
|
||||
:class="is_selling ? 'is-danger' : 'is-warning'"
|
||||
@click="is_selling = !is_selling"
|
||||
>
|
||||
<span class="icon">
|
||||
<i class="fas fa-coins"></i>
|
||||
</span>
|
||||
<p v-if="!is_selling">Vendre</p>
|
||||
<p v-else>{{ totalSellValue ? totalSellValue : 'Annuler' }}</p>
|
||||
</button>
|
||||
<PercentInput v-show="is_selling"></PercentInput>
|
||||
</div>
|
||||
<Loot v-if="is_adding" @done="is_adding = false"></Loot>
|
||||
<table v-else class="table is-fullwidth is-striped" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Objets de {{ player }}</th>
|
||||
<th v-if="canGrab"></th>
|
||||
<th v-if="canSell">
|
||||
<div class="buttons is-right">
|
||||
<button class="button"
|
||||
:class="is_selling ? 'is-danger' : 'is-warning'"
|
||||
@click="is_selling = !is_selling"
|
||||
>
|
||||
<span class="icon">
|
||||
<i class="fas fa-coins"></i>
|
||||
</span>
|
||||
<p v-if="!is_selling">
|
||||
Vendre</p>
|
||||
<p v-else>
|
||||
{{ totalSellValue ? totalSellValue : 'Annuler' }}</p>
|
||||
</button>
|
||||
<PercentInput v-show="is_selling">
|
||||
</PercentInput>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="(item, idx) in content">
|
||||
<tr :key="`row-${idx}`">
|
||||
<td>{{item.name}}</td>
|
||||
<td v-if="canGrab">
|
||||
<Request :item="item.id"></Request>
|
||||
<tbody>
|
||||
<template v-for="(item, idx) in content">
|
||||
<tr :key="`row-${idx}`">
|
||||
<td>{{item.name}}</td>
|
||||
<td v-if="canGrab">
|
||||
<Request :item="item.id"></Request>
|
||||
</td>
|
||||
<td v-if="canSell">
|
||||
<div class="field is-grouped is-pulled-right" v-show="is_selling">
|
||||
<div class="control">
|
||||
<label class="label">
|
||||
<input type="checkbox"
|
||||
<td v-if="canSell">
|
||||
<div class="field is-grouped is-pulled-right" v-show="is_selling">
|
||||
<div class="control">
|
||||
<label class="label">
|
||||
<input type="checkbox"
|
||||
id="`item-${idx}`"
|
||||
:value="item.id"
|
||||
v-model="sell_selected">
|
||||
{{item.sell_value}} GP
|
||||
</label>
|
||||
</div>
|
||||
<PercentInput></PercentInput>
|
||||
<PercentInput></PercentInput>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -94,6 +100,7 @@
|
||||
sell_value: 80000 },
|
||||
],
|
||||
is_selling: false,
|
||||
is_adding: false,
|
||||
sell_selected: [],
|
||||
};
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<p class="card-header-title">
|
||||
Nouveau loot</p>
|
||||
Nouveau loot - {{ looted.length }} objet(s)</p>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<ItemInput @addItem="onAddItem"></ItemInput>
|
||||
@@ -11,6 +11,10 @@
|
||||
{{ item }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a class="card-footer-item">Confirmer</a>
|
||||
<a @click="onClose" class="card-footer-item">Annuler</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -26,7 +30,10 @@
|
||||
methods: {
|
||||
onAddItem (item) {
|
||||
this.looted.push(item);
|
||||
}
|
||||
},
|
||||
onClose () {
|
||||
this.$emit('done');
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user