got to where it's relying on the store for something. nearly there.

This commit is contained in:
Jason Wheeler 2022-09-20 14:39:58 -04:00
parent 200b4bb141
commit d262d0ac1d
3 changed files with 13 additions and 9 deletions

View file

@ -1,9 +1,9 @@
<template> <template>
<input type="button" class="nav-button" v-bind:value="text"/> <input type="button" class="nav-button" v-bind:value="text" v-on:click="navTo"/>
</template> </template>
<script> <script>
export default({ export default({
name: "nav-button", name: "nav-button",
props: { props: {
@ -12,7 +12,12 @@
}, },
methods: { methods: {
navTo(){ navTo(){
alert(this.$router.navigate(this.scenario, this.$route))
}
},
computed: {
currentPage() {
return this.$route.query.issPage;
} }
} }

View file

@ -1,7 +1,7 @@
<template> <template>
<p>Welcome Page Placeholder</p> <p>Welcome Page Placeholder</p>
<br /> <br />
<NavButton text="Next"></NavButton> <NavButton text="Next" scenario="CLICKED_FORWARD"></NavButton>
</template> </template>
<script> <script>

View file

@ -2,8 +2,7 @@ import { createWebHistory, createRouter } from "vue-router";
import { lazyLoadComponent } from "./dynamic-routing/component-loader"; import { lazyLoadComponent } from "./dynamic-routing/component-loader";
import { endpoints } from "../constants/mock-endpoints"; import { endpoints } from "../constants/mock-endpoints";
import globalMethods from "@/global-methods"; import globalMethods from "@/global-methods";
import {issPageValues} from '@/router/router-constants/issPage-values';
const issPageValues = require("./router-constants/issPage-values");
const routes = [ const routes = [
{ {
@ -16,7 +15,7 @@ const routes = [
if(issPage === undefined) if(issPage === undefined)
{ {
issPage = issPageValues.issPageValues.WELCOME_PAGE; issPage = issPageValues.WELCOME_PAGE;
} }
if (router.hasRoute(issPage)) { if (router.hasRoute(issPage)) {
@ -84,7 +83,7 @@ async function GetRouteInfoFromPageName(pageName) {
} }
// Navigate to the next route, depending on the scenario. // Navigate to the next route, depending on the scenario.
async function navigate(scenario, currentRoute, optionalQuery = {}, optionalParams = {}) { router.navigate = async function (scenario, currentRoute, optionalQuery = {}, optionalParams = {}) {
if (!scenario) { if (!scenario) {
console.error("No scenario provided. Please review the routing table."); console.error("No scenario provided. Please review the routing table.");
return; return;
@ -124,7 +123,7 @@ function getNavigationMap(scenario, currentRoute) {
} }
function GoToStartOn404(next) { function GoToStartOn404(next) {
const errorPageName = issPageValues.issPageValues.ERROR_404; const errorPageName = issPageValues.ERROR_404;
router.addRoute({ router.addRoute({
path: "/", path: "/",
name: errorPageName, name: errorPageName,