-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
68 lines (62 loc) · 1.75 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Examples for Onlinesim api</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.2/vue.js"></script>
<script src="./dist/index.bundle.js"></script>
</head>
<body>
<div id="example1" >
<button type="button" @click="showCoutries">RUN</button>
<table>
<tbody>
<tr>
<td v-for="(data, key) in countries">
<button v-text="data.country_text" @click="showNumbers(data.country)"></button>
</td>
</tr>
<tr>
<td v-for="(data, key) in numbers">
<button v-text="data.full_number" @click="showMessages(data.number)"></button>
</td>
</tr>
</tbody>
</table>
<div v-for="(data, key) in messages">
<span v-text="data.in_number"></span>: <span v-text="data.text"></span>
</div>
<!-- DivTable.com -->
</div>
<script>
var driver = new window.OnlineSimDriver('').free()
new Vue({
data() {
return {
countries: {},
numbers: {},
messages: {},
};
},
el: '#example1',
methods: {
showCoutries: function () {
driver.countries().then((res) => {
this.countries = res
});
},
showNumbers: function (country) {
driver.numbers(country).then((res) => {
this.numbers = res
});
},
showMessages: function (number) {
driver.messages(number).then((res) => {
this.messages = res
});
}
},
});
</script>
</body>
</html>