Show/hide bullpen

This commit is contained in:
Peter 2024-11-09 11:44:19 -06:00
parent 1bc05eccc0
commit a7e1f4a755

View File

@ -1,7 +1,14 @@
<template>
<div class="bullpen-table">
<div class="row">
<h3>Bullpen</h3>
<h3>Bullpen
<button @click.stop="setVisiblity(!showBullpen)"
class="btn btn-sm btn-primary mb-2">
{{ showBullpen ? 'Hide' : 'Show' }}
</button>
</h3>
</div>
<div class="row" v-if="showBullpen">
<div class="table-responsive-xl">
<table class="table table-sm table-striped">
<thead class="thead-dark">
@ -68,7 +75,8 @@ export default {
data() {
return {
pitcherStatsByNameWeekGame: {} as Record<string, PitchingStat>,
sortedPlayers: [] as Player[]
sortedPlayers: [] as Player[],
showBullpen: false as boolean
}
},
props: {
@ -111,6 +119,9 @@ export default {
if (!stat) return '-'
return `${stat.ip.toFixed(1)}IP`
},
setVisiblity(state: boolean): void {
this.showBullpen = state
}
}
}