-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
41 lines (36 loc) · 1.02 KB
/
index.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
38
39
40
41
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<div id="app-5">
<button @click="reverseMessage">点击获取</button>
</div>
<script>
var app5 = new Vue({
el: '#app-5',
methods: {
reverseMessage: function () {
axios.get('http://192.168.1.101:58546/hello')
.then(function (response) {
// handle success
console.log(response.data);
alert(response.data)
})
.catch(function (error) {
// handle error
console.log(error);
})
.then(function () {
// always executed
});
}
}
})
</script>
</body>
</html>