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
52 lines (49 loc) · 1.22 KB
/
test.html
File metadata and controls
52 lines (49 loc) · 1.22 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
<!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({
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,
content: 'Delayed Hello World'
});
});
}, 5000);
});
botui.message.add({
human: true,
content: 'Hello World from human!'
}).then(function () {
botui.action.text({
action: {
button: {
icon: 'check',
label: 'Submit'
}
}
});
});
</script>
</body>
</html>