-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaxios.html
37 lines (37 loc) · 975 Bytes
/
axios.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>iview example</title>
<link rel="stylesheet" type="text/css" href="./styles/iview.css">
<script type="text/javascript" src="./js/vue.js"></script>
<script type="text/javascript" src="./js/iview.js"></script>
<script type="text/javascript" src="./js/axios.js"></script>
</head>
<body>
<div id="app">
<h1>Default...</h1>
{{ info }}
</div>
<script>
new Vue({
el: '#app',
data () {
return {
info: null
}
},
mounted () {
axios
// .get('https://api.coindesk.com/v1/bpi/currentprice.json')
.get('http://localhost:8086/datas/currentprice.json')
.then(response => (this.info = response))
.catch(function (error) {
// handle error
console.log(".............:%o",error);
})
}
})
</script>
</body>
</html>