An online poker tracker for PokerTH (https://pokerth.net). Continuation of https://github.com/Pik-9/PokerTH-Tracker https://finda.fish
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

46 lines
844 B

<template>
<span :class="textClass">{{ getLabel }}</span>
</template>
<script>
export default {
name: 'OpinionatedLabel',
props: {
value: Number,
low: Number,
high: Number,
percent: {
type: Boolean,
required: false,
default: true,
},
},
computed: {
textClass() {
let ret = [
'font-weight-bold',
'text-right',
];
if ((this.low) && (this.value < this.low)) {
ret = ret.concat(['deep-purple--text', 'text--darken-3']);
}
if ((this.high) && (this.value > this.high)) {
ret = ret.concat(['red--text', 'text--darken-4']);
}
return ret;
},
getLabel() {
return (this.percent
? `${Math.round(100 * this.value)} %`
: `${Math.round(this.value * 100) / 100}`
);
},
},
};
</script>