Slide 86
Slide 86 text
import axios from 'axios'
const CODESHIP_STATUSPAGE_URL = ‘…’
export default {
data () {
return {
status: 'loading',
description: ''
}
},
render () {
return this.$scopedSlots.default({
description: this.description,
statusClass: this.statusClass
})
},
computed: {
statusClass () {
return `header-item-status-${this.status}`
}
},
methods: {
success (response) {
this.status = response.data.status.indicator
this.description = response.data.status.description
}
},
created () {
axios.get(CODESHIP_STATUSPAGE_URL).then(this.success)
}
}