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

Commit

Permalink
checkout MapCard.vue from b8d647b
Browse files Browse the repository at this point in the history
  • Loading branch information
macropygia committed Mar 26, 2020
1 parent 9597ec7 commit e2e7640
Showing 1 changed file with 10 additions and 6 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

0 comments on commit e2e7640

Please sign in to comment.