chore: adjust click event and expand unit possibilities
This commit is contained in:
parent
5332f6035a
commit
9333b0d48f
|
@ -3,7 +3,7 @@
|
||||||
class="relative flex flex-col pt-2 pb-3 px-3 border rounded-lg overflow-hidden border-current"
|
class="relative flex flex-col pt-2 pb-3 px-3 border rounded-lg overflow-hidden border-current"
|
||||||
:class="[colorClasses, clickable ? 'cursor-pointer' : 'cursor-default']"
|
:class="[colorClasses, clickable ? 'cursor-pointer' : 'cursor-default']"
|
||||||
:disable="!clickable"
|
:disable="!clickable"
|
||||||
@click="$emit('click')"
|
@click="clickable && $emit('click')"
|
||||||
>
|
>
|
||||||
<progress
|
<progress
|
||||||
v-if="!clickable"
|
v-if="!clickable"
|
||||||
|
@ -13,7 +13,9 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<span class="absolute top-3 right-3 font-semibold text-sm">
|
<span class="absolute top-3 right-3 font-semibold text-sm">
|
||||||
{{ cappedValueText }} / {{ maxText }}
|
<span v-if="unit === 'apprenticeLevels'">L</span>{{ cappedValueText }}
|
||||||
|
/
|
||||||
|
<span v-if="unit === 'apprenticeLevels'">L</span>{{ maxText }}
|
||||||
<span v-if="unit === 'spareTime'" class="fas fa-hourglass-half" />
|
<span v-if="unit === 'spareTime'" class="fas fa-hourglass-half" />
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
@ -50,14 +52,12 @@ export default {
|
||||||
return this.value > this.max ? this.max : this.value
|
return this.value > this.max ? this.max : this.value
|
||||||
},
|
},
|
||||||
cappedValueText() {
|
cappedValueText() {
|
||||||
return this.unit === 'spareTime'
|
return this.unit === 'maxAge'
|
||||||
? this.cappedValue
|
? this.$store.getters.ageText
|
||||||
: this.$store.getters.ageText
|
: this.cappedValue
|
||||||
},
|
},
|
||||||
maxText() {
|
maxText() {
|
||||||
return this.unit === 'spareTime'
|
return this.unit === 'maxAge' ? this.$store.getters.ageMaxText : this.max
|
||||||
? this.max
|
|
||||||
: this.$store.getters.ageMaxText
|
|
||||||
},
|
},
|
||||||
clickable() {
|
clickable() {
|
||||||
return this.value >= this.max
|
return this.value >= this.max
|
||||||
|
|
Reference in New Issue