forked from bailicangdu/vue2-manage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisitor.vue
More file actions
45 lines (42 loc) · 875 Bytes
/
visitor.vue
File metadata and controls
45 lines (42 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<template>
<div>
<head-top></head-top>
<visitor-pie :pieData="pieData"></visitor-pie>
</div>
</template>
<script>
import headTop from '../components/headTop'
import visitorPie from '@/components/visitorPie'
import {getUserCity} from '@/api/getData'
export default {
data(){
return {
pieData: {},
}
},
components: {
headTop,
visitorPie,
},
mounted(){
this.initData();
},
methods: {
async initData(){
try{
const res = await getUserCity();
if (res.status == 1) {
this.pieData = res.user_city;
}else{
throw new Error(res)
}
}catch(err){
console.log('获取用户分布信息失败',err);
}
},
}
}
</script>
<style lang="less">
@import '../style/mixin';
</style>