-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.vue
More file actions
72 lines (65 loc) · 1.53 KB
/
app.vue
File metadata and controls
72 lines (65 loc) · 1.53 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
62
63
64
65
66
67
68
69
70
71
72
<script setup lang="ts">
import { AisInstantSearch } from "vue-instantsearch/vue3/es";
import { createTypesenseAdapter } from "../utils/instantSearchAdapter";
import Heading from "../components/Heading.vue";
import SearchBar from "../components/SearchBar.vue";
import BookList from "../components/BookList.vue";
const config = useRuntimeConfig();
const typesenseConfig = config.public.typesense;
const typesenseAdapter = createTypesenseAdapter({
apiKey: typesenseConfig.apiKey,
host: typesenseConfig.host,
port: typesenseConfig.port,
protocol: typesenseConfig.protocol,
});
useHead({
title: "Nuxt.js Search Bar",
meta: [
{
name: "description",
content: "Search through our collection of books",
},
],
link: [
{
rel: "icon",
type: "image/png",
href: "/favicon.png",
},
],
});
</script>
<template>
<div class="app-container">
<div class="app-content">
<AisInstantSearch
:search-client="typesenseAdapter.searchClient"
:index-name="typesenseConfig.index"
>
<Heading />
<SearchBar />
<BookList />
</AisInstantSearch>
</div>
</div>
</template>
<style>
* {
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</style>
<style scoped>
.app-container {
min-height: 100vh;
background-color: #f9fafb;
padding: 2rem 1rem;
}
.app-content {
max-width: 80rem;
margin: 0 auto;
}
</style>