SEPTA transit board for me
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

47 lines
823 B

<template>
<div id="app">
<section>
<h1>Transit Board</h1>
<p>
{{ now.getHours() }}:{{ now.getMinutes() }}:{{ now.getSeconds() }}
</p>
</section>
<section>
<button v-on:click="test">Test</button>
<h2>🚌 45</h2>
<ul>
<li v-for="arrival in bus" v-bind:key="arrival.trip">
{{ arrival.Direction }}, {{ arrival.late }} minutes late
</li>
</ul>
</section>
</div>
</template>
<script>
export default {
name: 'app',
data: function () {
return {
now: new Date(),
bus: []
}
},
methods: {
test: function () {
this.$http.get('/test_45_0.json').then(response => {
this.bus = response.body.bus
})
}
},
created () {
setInterval(() => {
this.now = new Date()
}, 1000)
}
}
</script>
<style>
</style>