forked from botui/botui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
61 lines (57 loc) · 1.63 KB
/
test.html
File metadata and controls
61 lines (57 loc) · 1.63 KB
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
<!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 src="https://unpkg.com/vue"></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
})
});
});
botui.message.add({
human: true,
photo: false,
content: 'Hello World from human!'
}).then(function () {
var minData = new Date()
minData.setDate(minData.getDate()+60)
botui.action.datepicker({
action: {
msg: (arr) => `De ${arr[0]} até ${arr[1]}`,
placeholder: 'Data inicio',
shortcuts: false,
confirm: true,
format: "DD/MM/YYYY",
language: "pt-br",
min: minData,
handleConfirm: "handle_action_datepicker()",
rangeSeparator: "até",
confirmText: "Enviar",
handleKeyDown: (event) => console.log(event)
}
}).then(function (res) {
console.log(res.value);
});
});
</script>
</body>
</html>