cec-nuxt-lib 0.7.9 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { onMounted } from 'vue';
|
|
3
3
|
import { useState } from '#app';
|
|
4
4
|
|
|
5
|
-
const searchTerm = useState('searchTerm', () =>
|
|
5
|
+
const searchTerm = useState('searchTerm', () => undefined);
|
|
6
6
|
const showSiteSearch = useState('showSiteSearch');
|
|
7
7
|
const questions = useState('questions');
|
|
8
8
|
const baseUrl = useState('baseUrl');
|
|
@@ -102,6 +102,15 @@ let updateToggleText = () => {
|
|
|
102
102
|
console.log('toggle');
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
+
const doSearch = async () => {
|
|
106
|
+
if (searchTerm.value) {
|
|
107
|
+
await navigateTo(
|
|
108
|
+
`https://www.cheshireeast.gov.uk/search-results?search_keywords=${encodeURI(searchTerm.value)}`,
|
|
109
|
+
{ external: true }
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
105
114
|
// Set some things up once page has mounted.
|
|
106
115
|
onMounted(() => {
|
|
107
116
|
updateToggleText = () => {
|
|
@@ -442,21 +451,21 @@ onMounted(() => {
|
|
|
442
451
|
>
|
|
443
452
|
<input
|
|
444
453
|
v-model="searchTerm"
|
|
454
|
+
@keypress.enter="doSearch"
|
|
455
|
+
placeholder="Enter keywords:"
|
|
445
456
|
@focus="searchTerm = ''"
|
|
446
457
|
type="text"
|
|
447
458
|
id="searchTextBox"
|
|
448
459
|
class="sys_searchbox"
|
|
449
460
|
/>
|
|
450
|
-
<
|
|
461
|
+
<button
|
|
462
|
+
type="button"
|
|
463
|
+
@click="doSearch"
|
|
451
464
|
id="SearchQueryControl_SearchButton"
|
|
452
465
|
class="sys_button sys_searchbutton sys_search-button"
|
|
453
|
-
:href="
|
|
454
|
-
searchTerm === 'Enter keywords:'
|
|
455
|
-
? 'javascript:'
|
|
456
|
-
: `https://www.cheshireeast.gov.uk/search-results?search_keywords=${encodeURI(searchTerm)}`
|
|
457
|
-
"
|
|
458
|
-
>Search</a
|
|
459
466
|
>
|
|
467
|
+
Search
|
|
468
|
+
</button>
|
|
460
469
|
</div>
|
|
461
470
|
</div>
|
|
462
471
|
</div>
|
package/package.json
CHANGED