From f03c8e346a68fbf4043ef3cd0996fcaaca3e315d Mon Sep 17 00:00:00 2001 From: Mark Eaton Date: Sat, 1 Jul 2023 15:50:47 -0400 Subject: [PATCH] onesearch component appears, not working --- groups/home/Vue3-v.4.html | 8 +++++- groups/home/src/main4.js | 51 ++++++++++++++++++++------------------- 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/groups/home/Vue3-v.4.html b/groups/home/Vue3-v.4.html index 3fa6c16..4fc593d 100644 --- a/groups/home/Vue3-v.4.html +++ b/groups/home/Vue3-v.4.html @@ -121,7 +121,13 @@
- +
diff --git a/groups/home/src/main4.js b/groups/home/src/main4.js index 49e0671..42e3985 100644 --- a/groups/home/src/main4.js +++ b/groups/home/src/main4.js @@ -48,7 +48,6 @@ const navigComponent = {
`, props: ['navlistofmenus'] - } const onesearchComponent = { @@ -58,14 +57,14 @@ const onesearchComponent = { ref="oneSearchForm" role="search" method="get" - :action="selectedItem.baseUrl" + :action="selecteditem.baseUrl" enctype="application/x-www-form-urlencoded; charset=utf-8" > -
+
- - + + @@ -90,12 +89,12 @@ const onesearchComponent = { aria-expanded="true" aria-label="Define Your Search" > - {{ displayedItem }}  + {{ displayeditem }} 
@@ -132,12 +131,12 @@ const onesearchComponent = {
`, - props: ['selectedItem'] + props: ['selecteditem', 'searchstring', 'placeholderstring', 'displayeditem', 'materialtype'] } const { createApp } = Vue -createApp({ +const app1 = createApp({ components: { 'navig-component': navigComponent, 'hamburger-component': hamburgerComponent @@ -364,22 +363,23 @@ createApp({ } } } -}).mount('#app1'); +}) +app1.mount('#app1'); -createApp({ +const app2 = createApp({ components: { 'onesearch-component': onesearchComponent }, methods: { selectDropdown(item, itemName) { - this.displayedItem = itemName; // swap in current item at the top of the dropdown - this.selectedItem = item; // store the data from the dropdown selection - this.placeholderString = 'Enter search term here'; + this.displayeditem = itemName; // swap in current item at the top of the dropdown + this.selecteditem = item; // store the data from the dropdown selection + this.placeholderstring = 'Enter search term here'; }, submitSearch() { - if (this.displayedItem === 'Define Your Search') { - this.placeholderString = 'Please make a selection'; - this.searchString = ''; // remove the search string + if (this.displayeditem === 'Define Your Search') { + this.placeholderstring = 'Please make a selection'; + this.searchstring = ''; // remove the search string if (!this.$refs.blueBorder1.classList.contains('open')) { // if the dropdown is not open this.$refs.oneSearchMenu.click(); // open the dropdown } @@ -391,11 +391,11 @@ createApp({ }, data() { return { - selectedItem: {}, // initialize the data from the dropdown selection - searchString: '', // initialize an empty search string - placeholderString: 'Enter search term here', // initialize the placeholder - displayedItem: 'Define Your Search', // the text displayed a the top of the OneSearch dropdown - materialType: { + selecteditem: {}, // initialize the data from the dropdown selection + searchstring: '', // initialize an empty search string + placeholderstring: 'Enter search term here', // initialize the placeholder + displayeditem: 'Define Your Search', // the text displayed a the top of the OneSearch dropdown + materialtype: { Books: { fullName: 'Books', baseUrl: 'https://cuny-kb.primo.exlibrisgroup.com/discovery/search', @@ -439,4 +439,5 @@ createApp({ } } } -}).mount('#app2'); +}) +app2.mount('#app2');