Initial test comments added. Some original commented code deleted
This commit is contained in:
parent
d75ab4f367
commit
3dbb04d737
4 changed files with 22 additions and 15 deletions
|
|
@ -11,6 +11,9 @@ import { Suggestion } from "@/models/dataset";
|
|||
export default class HomeViewComponent extends Vue {
|
||||
public display = "";
|
||||
|
||||
/* This method is called when a search suggestion is selected. It takes a parameter suggestion which can be either a Suggestion object or a string.
|
||||
If it's a string, the method extracts the term and navigates to the "Search" route with the term as a parameter. If it's a Suggestion object, it extracts
|
||||
the value and type from the suggestion and navigates to the "Search" route with both parameters.*/
|
||||
onSearch(suggestion: Suggestion | string): void {
|
||||
let term;
|
||||
if (typeof suggestion === "string") {
|
||||
|
|
@ -22,6 +25,7 @@ export default class HomeViewComponent extends Vue {
|
|||
}
|
||||
}
|
||||
|
||||
/* This method is called when the user initiates a search. It navigates to the "Search" route with the display property as a parameter. */
|
||||
search(): void {
|
||||
this.$router.push({ name: "Search", params: { display: this.display } });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue