commit
This commit is contained in:
parent
f22f42c260
commit
4cd3f62421
3 changed files with 5 additions and 6 deletions
|
|
@ -3,12 +3,14 @@ import App from './App.vue';
|
||||||
import router from './router';
|
import router from './router';
|
||||||
import "../node_modules/bootstrap/dist/js/bootstrap.js";
|
import "../node_modules/bootstrap/dist/js/bootstrap.js";
|
||||||
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
|
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
|
||||||
import { useMainStore, pinia } from '@/store';
|
import { useMainStore, } from '@/store';
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
import { createPinia } from 'pinia';
|
||||||
|
|
||||||
const vueApp = createApp(App);
|
const vueApp = createApp(App);
|
||||||
|
|
||||||
// Pinia
|
// Pinia
|
||||||
|
const pinia = createPinia();
|
||||||
vueApp.use(pinia);
|
vueApp.use(pinia);
|
||||||
pinia.use(piniaPluginPersistedstate);
|
pinia.use(piniaPluginPersistedstate);
|
||||||
useMainStore().populateInitialState();
|
useMainStore().populateInitialState();
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader";
|
||||||
import {issPageValues} from '@/router/router-constants/issPage-values';
|
import {issPageValues} from '@/router/router-constants/issPage-values';
|
||||||
import { routingTable } from "@/router/router-constants/routing-table";
|
import { routingTable } from "@/router/router-constants/routing-table";
|
||||||
import { useMainStore } from '@/store';
|
import { useMainStore } from '@/store';
|
||||||
import { pinia } from "../store";
|
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
|
|
@ -55,7 +54,7 @@ const router = createRouter({
|
||||||
// Get route information by page name.
|
// Get route information by page name.
|
||||||
// This will reach out to the Cms and there is a 1:1 relationship between page names and route names.
|
// This will reach out to the Cms and there is a 1:1 relationship between page names and route names.
|
||||||
async function GetRouteInfoFromPageName(pageName) {
|
async function GetRouteInfoFromPageName(pageName) {
|
||||||
const response = await useMainStore(pinia).getRouteInfo(pageName);
|
const response = await useMainStore().getRouteInfo(pageName);
|
||||||
|
|
||||||
const jsonFromResponse = JSON.parse(response.data.Result);
|
const jsonFromResponse = JSON.parse(response.data.Result);
|
||||||
let routeData = [];
|
let routeData = [];
|
||||||
|
|
@ -123,7 +122,7 @@ function navigateToUrl(url, optionalQuery = {}) {
|
||||||
function getNavigationMap (scenario, currentRoute) {
|
function getNavigationMap (scenario, currentRoute) {
|
||||||
const issPageValue = currentRoute.query.issPage;
|
const issPageValue = currentRoute.query.issPage;
|
||||||
try {
|
try {
|
||||||
const matchedQueryValue = routingTable(useMainStore(pinia))
|
const matchedQueryValue = routingTable(useMainStore())
|
||||||
.filter(
|
.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
item.issPageValue === issPageValue &&
|
item.issPageValue === issPageValue &&
|
||||||
|
|
|
||||||
|
|
@ -92,5 +92,3 @@ export const useMainStore = defineStore({
|
||||||
},
|
},
|
||||||
persist: true
|
persist: true
|
||||||
});
|
});
|
||||||
|
|
||||||
export const pinia = createPinia();
|
|
||||||
Loading…
Reference in a new issue