-
Notifications
You must be signed in to change notification settings - Fork 2
/
demo.html
38 lines (35 loc) · 1.16 KB
/
demo.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Search</title>
<!-- As this is used directly for development web-dev-server, set the src directly to the correct file -->
<script type="module" src="src/vocab-search-bar.js"></script>
<script>
window.onload = function () {
const container = document.querySelector("#container");
container.addEventListener("search-results-changed", (event) => {
// console.log(JSON.stringify(event.detail))
console.log(`The search results have changed`);
});
container.addEventListener("selection-changed", (event) => {
console.log(`A search result was clicked:`);
// console.log(JSON.stringify(event.detail))
});
};
</script>
</head>
<body>
<h1>Search</h1>
<div id="container">
<vocab-search-bar
id="search"
search-endpoint="https://vocab.vliz.be/"
languages-string="nl"
>
</vocab-search-bar>
</div>
</body>
</html>