-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathtest.html
executable file
·69 lines (66 loc) · 1.98 KB
/
test.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
69
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="build/botui.min.css">
<link rel="stylesheet" href="build/botui-theme-default.css">
</head>
<body>
<div class="botui-app-container" id="hello-world">
<bot-ui></bot-ui>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="build/botui.js"></script>
<script>
var botui = new BotUI('hello-world');
botui.message.add({
photo: 'https://moin.im/face.svg',
loading: true
}).then(function (index) {
setTimeout(function () {
botui.message.update(index, {
content: 'Hello World from bot!',
loading: false
}).then(function () {
botui.message.add({
delay: 2000,
//loading: true,
photo: true,
photo: 'https://moin.im/face.svg',
content: 'Delayed Hello World'
});
});
}, 5000);
});
botui.message.add({
human: true,
photo: false,
content: 'Hello World from human!'
}).then(function () {
botui.action.select({
action: {
placeholder : "Select Language",
value: 'TR,EN', // Selected value or Selected Array object. Example: [{value: "TR", text : "Türkçe" },{value: "EN", text : "English" }]
multipleselect : true, // Default: false
options : [
{value: "EN", text : "English" },
{value: "ES", text : "Español" },
{value: "TR", text : "Türkçe" },
{value: "DE", text : "Deutsch" },
{value: "FR", text : "Français" },
{value: "IT", text : "Italiano" },
],
button: {
icon: 'check',
label: 'OK'
}
}
}).then(function (res) {
console.log(res.value);
});
});
</script>
</body>
</html>