forked from Tokyo-Metro-Gov/covid19
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfirmedCasesByMunicipalitiesTable.vue
108 lines (100 loc) · 2.14 KB
/
ConfirmedCasesByMunicipalitiesTable.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<template>
<data-view :title="title" :title-id="titleId" :date="date">
<template v-slot:description>
<slot name="description" />
</template>
<v-data-table
:ref="'displayedTable'"
:headers="chartData.headers"
:items="chartData.datasets"
:items-per-page="-1"
:hide-default-footer="true"
:height="240"
:fixed-header="true"
:mobile-breakpoint="0"
:disable-sort="true"
class="cardTable"
/>
<template v-slot:infoPanel>
<data-view-basic-info-panel
:l-text="info.lText"
:s-text="info.sText"
:unit="info.unit"
/>
</template>
</data-view>
</template>
<style lang="scss">
.cardTable {
&.v-data-table {
box-shadow: 0 -20px 12px -12px #0003 inset;
th {
padding: 8px 10px;
height: auto;
border-bottom: 1px solid $gray-4;
color: $gray-2;
@include font-size(12);
}
tbody {
tr {
color: $gray-1;
th {
font-weight: normal;
}
td {
padding: 8px 10px;
height: auto;
@include font-size(12);
}
&:nth-child(odd) {
th,
td {
background: rgba($gray-4, 0.3);
}
}
}
}
&:focus {
outline: dotted $gray-3 1px;
}
}
}
</style>
<script lang="ts">
import Vue from 'vue'
import DataView from '@/components/DataView.vue'
import DataViewBasicInfoPanel from '@/components/DataViewBasicInfoPanel.vue'
export default Vue.extend({
components: { DataView, DataViewBasicInfoPanel },
props: {
title: {
type: String,
default: ''
},
titleId: {
type: String,
default: ''
},
chartData: {
type: Object,
default: () => {}
},
date: {
type: String,
default: ''
},
info: {
type: Object,
default: () => {}
}
},
mounted() {
const vTables = this.$refs.displayedTable as Vue
const vTableElement = vTables.$el
const tables = vTableElement.querySelectorAll('table')
tables.forEach((table: HTMLElement) => {
table.setAttribute('tabindex', '0')
})
}
})
</script>