-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
33 lines (28 loc) · 929 Bytes
/
index.js
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
Vue.use(VueTables.ClientTable);
const State = { template: '<div>State: {{ $route.params.state }} </div>' }
const District = { template: '<div>District: </div>' }
const routes = [
{ path: '/state/:state', component: State },
{ path: '/district/:district', component: District },
]
const router = new VueRouter({
routes
})
const app = new Vue({
router
}).$mount('#app')
data() {
return {
states: []
}
}
mounted() {
fetch("https://cdn-api.co-vin.in/api/v2/admin/location/states",
headers = {
"accept": "application/json",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36",
})
.then(res => res.json())
.then(data => this.jobs = data),
.catch(err => console.log(err.message))
}