-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample3.html
More file actions
32 lines (29 loc) · 730 Bytes
/
Copy pathsample3.html
File metadata and controls
32 lines (29 loc) · 730 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
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>vueを使ってaxiosを学ぶ</title>
</head>
<body>
<div id="app">
<h1>{{ message }}</h1>
</div>
<script src="https://unpkg.com/vue@next"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
Vue.createApp({
el: '#app',
data(){
return {
message: 'Hello Axios',
}
},
mounted(){
axios.get('https://sample.novalumoapis.com/api/users')
.then(response => console.log(response))
.catch(error => console.log(error))
}
}).mount('#app')
</script>
</body>
</html>