update dashboard

This commit is contained in:
郑杰
2018-12-23 11:20:54 +08:00
parent a3c118e3a7
commit e1d18217f2
2 changed files with 13 additions and 20 deletions

View File

@@ -49,16 +49,23 @@
<script>
import CountTo from 'vue-count-to'
import { get } from '@/api/visits'
export default {
components: {
CountTo
},
props: {
count: {
type: Object,
required: true
data() {
return {
count: { newIp: 0, newVisits: 0, recentIp: 0, recentVisits: 0 }
}
},
mounted() {
get().then(res => {
this.count.newIp = res.newIp
this.count.newVisits = res.newVisits
this.count.recentIp = res.recentIp
this.count.recentVisits = res.recentVisits
})
}
}
</script>