|
1 | 1 | <template> |
2 | | - <div className="p-3" id="app"> |
3 | | - <reactive-base |
4 | | - app="good-books-ds" |
5 | | - url="https://a03a1cb71321:75b6603d-9456-4a5a-af6b-a487b309eb61@appbase-demo-ansible-abxiydt-arc.searchbase.io" |
6 | | - > |
7 | | - <search-box |
8 | | - className="result-list-container" |
9 | | - componentId="BookSensor" |
10 | | - :dataField="['original_title', 'original_title.search']" |
11 | | - :URLParams="true" |
12 | | - :size="3" |
13 | | - :enablePopularSuggestions="true" |
14 | | - :enableRecentSearches="true" |
15 | | - :innerClass="{ |
16 | | - input: 'bg-gray-300 border-2 border-blue-500', |
17 | | - }" |
18 | | - /> |
19 | | - <reactive-list |
20 | | - componentId="SearchResult" |
21 | | - dataField="original_title.keyword" |
22 | | - className="result-list-container" |
23 | | - :pagination="true" |
24 | | - :size="5" |
25 | | - :react="{ and: ['BookSensor'] }" |
26 | | - > |
27 | | - <template #renderItem="{ item }"> |
28 | | - <div :id="item._id" class="flex book-content" :key="item._id"> |
29 | | - <img :src="item.image" alt="Book Cover" class="book-image" /> |
30 | | - <div class="flex column justify-center ml20"> |
31 | | - <div class="book-header">{{ item.original_title }}</div> |
32 | | - <div class="flex column justify-space-between"> |
33 | | - <div> |
34 | | - <div> |
35 | | - by <span class="authors-list">{{ item.authors }}</span> |
36 | | - </div> |
37 | | - <div class="ratings-list flex align-center"> |
38 | | - <span class="stars"> |
39 | | - <i |
40 | | - v-for="(item, index) in Array( |
41 | | - item.average_rating_rounded, |
42 | | - ).fill('x')" |
43 | | - class="fas fa-star" |
44 | | - :key="index" |
45 | | - /> |
46 | | - </span> |
47 | | - <span class="avg-rating" |
48 | | - >({{ item.average_rating }} avg)</span |
49 | | - > |
50 | | - </div> |
51 | | - </div> |
52 | | - <span class="pub-year" |
53 | | - >Pub {{ item.original_publication_year }}</span |
54 | | - > |
55 | | - </div> |
56 | | - </div> |
57 | | - </div> |
58 | | - </template> |
59 | | - </reactive-list> |
60 | | - </reactive-base> |
61 | | - </div> |
| 2 | + <div |
| 3 | + id="app" |
| 4 | + class="p-3 bg-gradient-to-r from-green-400 to-blue-500"> |
| 5 | + <reactive-base |
| 6 | + app="good-books-ds" |
| 7 | + url="https://a03a1cb71321:75b6603d-9456-4a5a-af6b-a487b309eb61@appbase-demo-ansible-abxiydt-arc.searchbase.io" |
| 8 | + > |
| 9 | + <search-box |
| 10 | + :data-field="['original_title', 'original_title.search']" |
| 11 | + :urlparams="true" |
| 12 | + :size="3" |
| 13 | + :enable-popular-suggestions="true" |
| 14 | + :enable-recent-searches="true" |
| 15 | + :inner-class="{ |
| 16 | + input: 'bg-gray-300 border-2 border-blue-500', |
| 17 | + }" |
| 18 | + class-name="result-list-container mt-4" |
| 19 | + component-id="BookSensor" |
| 20 | + /> |
| 21 | + <reactive-list |
| 22 | + :pagination="true" |
| 23 | + :size="5" |
| 24 | + :react="{ and: ['BookSensor'] }" |
| 25 | + component-id="SearchResult" |
| 26 | + data-field="original_title.keyword" |
| 27 | + class-name="result-list-container" |
| 28 | + > |
| 29 | + <template #renderItem="{ item }"> |
| 30 | + <div |
| 31 | + :id="item._id" |
| 32 | + :key="item._id" |
| 33 | + class="flex book-content"> |
| 34 | + <img |
| 35 | + :src="item.image" |
| 36 | + alt="Book Cover" |
| 37 | + class="book-image" > |
| 38 | + <div class="flex column justify-center ml20"> |
| 39 | + <div class="book-header">{{ item.original_title }}</div> |
| 40 | + <div class="flex column justify-space-between"> |
| 41 | + <div> |
| 42 | + <div> |
| 43 | + by <span class="authors-list">{{ item.authors }}</span> |
| 44 | + </div> |
| 45 | + <div class="ratings-list flex align-center"> |
| 46 | + <span class="stars"> |
| 47 | + <i |
| 48 | + v-for="(item, index) in Array( |
| 49 | + item.average_rating_rounded, |
| 50 | + ).fill('x')" |
| 51 | + :key="index" |
| 52 | + class="fas fa-star" |
| 53 | + /> |
| 54 | + </span> |
| 55 | + <span |
| 56 | + class="avg-rating" |
| 57 | + >({{ item.average_rating }} avg)</span |
| 58 | + > |
| 59 | + </div> |
| 60 | + </div> |
| 61 | + <span |
| 62 | + class="pub-year" |
| 63 | + >Pub {{ item.original_publication_year }}</span |
| 64 | + > |
| 65 | + </div> |
| 66 | + </div> |
| 67 | + </div> |
| 68 | + </template> |
| 69 | + </reactive-list> |
| 70 | + </reactive-base> |
| 71 | + </div> |
62 | 72 | </template> |
63 | 73 |
|
64 | 74 | <script> |
65 | | -import './styles.css'; |
66 | 75 | import { ReactiveBase, ReactiveList, SearchBox } from '@appbaseio/reactivesearch-vue' |
67 | 76 |
|
68 | 77 | export default { |
69 | | - name: 'app', |
| 78 | + name: 'App', |
70 | 79 | components: { |
71 | 80 | ReactiveBase, |
72 | 81 | ReactiveList, |
|
0 commit comments