Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions scripts/__snapshots__/e2e-templates.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4411,16 +4411,22 @@ exports[`Templates Vue InstantSearch File content: src/App.vue 1`] = `
'ais-search-box__submit': 'ais-SearchBox-submit',
'ais-search-box__loading-indicator': 'ais-SearchBox-loadingIndicator',
}\\"
></ais-search-box>
/>

<ais-results class=\\"ais-Hits-list\\">
<template slot-scope=\\"{ result }\\">
<article class=\\"ais-Hits-item\\">
<h1>
<ais-highlight :result=\\"result\\" attribute-name=\\"attribute1\\"></ais-highlight>
<ais-highlight
:result=\\"result\\"
attribute-name=\\"attribute1\\"
/>
</h1>
<p>
<ais-highlight :result=\\"result\\" attribute-name=\\"attribute2\\"></ais-highlight>
<ais-highlight
:result=\\"result\\"
attribute-name=\\"attribute2\\"
/>
</p>
</article>
</template>
Expand All @@ -4438,7 +4444,7 @@ exports[`Templates Vue InstantSearch File content: src/App.vue 1`] = `
'ais-pagination__item--last': 'ais-Pagination-item--last',
'ais-pagination__link': 'ais-Pagination-link',
}\\"
></ais-pagination>
/>
</div>
</div>
</div>
Expand Down Expand Up @@ -4529,6 +4535,7 @@ import InstantSearch from 'vue-instantsearch';

Vue.use(InstantSearch);

// eslint-disable-next-line no-new
new Vue({
el: '#app',
render: h => h(App),
Expand Down
1 change: 1 addition & 0 deletions src/templates/Vue InstantSearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"eslint-plugin-html": "4.0.5",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-prettier": "2.6.2",
"eslint-plugin-vue": "4.7.1",
"file-loader": "2.0.0",
"prettier": "1.14.2",
"vue-loader": "14.2.3",
Expand Down
16 changes: 11 additions & 5 deletions src/templates/Vue InstantSearch/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,33 @@
'ais-search-box__submit': 'ais-SearchBox-submit',
'ais-search-box__loading-indicator': 'ais-SearchBox-loadingIndicator',
}"
></ais-search-box>
/>

{{#if attributesToDisplay}}
<ais-results class="ais-Hits-list">
<template slot-scope="{ result }">
<article class="ais-Hits-item">
<h1>
<ais-highlight :result="result" attribute-name="{{attributesToDisplay.[0]}}"></ais-highlight>
<ais-highlight
:result="result"
attribute-name="{{attributesToDisplay.[0]}}"
/>
</h1>
{{#each attributesToDisplay}}
{{#unless @first}}
<p>
<ais-highlight :result="result" attribute-name="{{this}}"></ais-highlight>
<ais-highlight
:result="result"
attribute-name="{{this}}"
/>
</p>
{{/unless}}
{{/each}}
</article>
</template>
</ais-results>
{{else}}
<ais-results class="ais-Hits-list"></ais-results>
<ais-results class="ais-Hits-list" />
{{/if}}

<div class="pagination">
Expand All @@ -74,7 +80,7 @@
'ais-pagination__item--last': 'ais-Pagination-item--last',
'ais-pagination__link': 'ais-Pagination-link',
}"
></ais-pagination>
/>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/templates/Vue InstantSearch/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import InstantSearch from 'vue-instantsearch';

Vue.use(InstantSearch);

// eslint-disable-next-line no-new
new Vue({
el: '#app',
render: h => h(App),
Expand Down