Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2387 from tokyo-metropolitan-gov/feature/issue-23…
Browse files Browse the repository at this point in the history
…46-add-map-update-date

Feature/issue 2346 add map update date
  • Loading branch information
halsk authored Mar 26, 2020
2 parents 38e7fd3 + 97e8a8a commit b8d647b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 10 additions & 6 deletions components/MapCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<data-view
:title="title"
:title-id="titleId"
:date="date"
:date="updateDate"
:url="url"
:loading="loading"
class="MapCard"
Expand Down Expand Up @@ -76,10 +76,6 @@ export default {
type: String,
default: ''
},
date: {
type: String,
default: ''
},
detailPageUrl: {
type: String,
default: ''
Expand Down Expand Up @@ -135,7 +131,8 @@ export default {
const dateSliderValue = 0
const legendData = []
const loading = true
return { dateTicks, legendData, loading, dateSliderValue }
const updateDate = ''
return { dateTicks, legendData, loading, dateSliderValue, updateDate }
},
computed: {
dataDate() {
Expand All @@ -149,6 +146,13 @@ export default {
})
}
},
created() {
const self = this
fetch('https://tokyo-metropolitan-gov.github.io/data/stat.json')
.then(response => response.json())
.then(res => (self.updateDate = res.yahootile.lastUpdate))
.catch(_ => (self.updateDate = ''))
},
methods: {
updateLegend(legendData) {
this.legendData = legendData
Expand Down
2 changes: 0 additions & 2 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
:detail-page-url="'/largemap'"
:detail-page-string="$t('東京23区の人口推移(参考値)')"
:link-string="$t('ヤフー・データソリューション')"
:date="''"
/>
</v-col>
<v-col cols="12" md="6" class="DataCard">
Expand All @@ -76,7 +75,6 @@
:detail-page-url="'/largemap'"
:detail-page-string="$t('東京23区の人口推移(参考値)')"
:link-string="$t('ヤフー・データソリューション')"
:date="''"
/>
</v-col>
</v-row>
Expand Down

0 comments on commit b8d647b

Please sign in to comment.