mirror of https://github.com/rancher/dashboard.git
Resolving router-related warnings
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
This commit is contained in:
parent
b4d08bb704
commit
48869fa982
|
|
@ -1,22 +1,21 @@
|
|||
import { createApp } from 'vue';
|
||||
import { createRouter } from 'vue-router';
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import Routes from '@shell/config/router/routes';
|
||||
import { installNavigationGuards } from '@shell/config/router/navigation-guards';
|
||||
const vueApp = createApp({});
|
||||
|
||||
vueApp.use(Router);
|
||||
|
||||
export const routerOptions = {
|
||||
mode: 'history',
|
||||
export const routerOptions = createRouter({
|
||||
history: createWebHistory(process.env.routerBase || '/'),
|
||||
// Note: router base comes from the ROUTER_BASE env var
|
||||
base: process.env.routerBase || '/',
|
||||
routes: Routes,
|
||||
fallback: false
|
||||
};
|
||||
fallback: false,
|
||||
});
|
||||
|
||||
export function extendRouter(config, context) {
|
||||
const base = (config._app && config._app.basePath) || routerOptions.base;
|
||||
const router = new Router({ ...routerOptions, base });
|
||||
const router = createRouter({
|
||||
...routerOptions,
|
||||
base,
|
||||
});
|
||||
|
||||
installNavigationGuards(router, context);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { productsLoaded } from '@shell/store/type-map';
|
||||
import { clearModelCache } from '@shell/plugins/dashboard-store/model-loader';
|
||||
import { Plugin } from './plugin';
|
||||
import { PluginRoutes } from './plugin-routes';
|
||||
// import { PluginRoutes } from './plugin-routes';
|
||||
import { UI_PLUGIN_BASE_URL } from '@shell/config/uiplugins';
|
||||
import { ExtensionPoint } from './types';
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ export default function(context, inject, vueApp) {
|
|||
// Track which plugin loaded what, so we can unload stuff
|
||||
const plugins = {};
|
||||
|
||||
const pluginRoutes = new PluginRoutes(app.router);
|
||||
// const pluginRoutes = new PluginRoutes(app.router);
|
||||
|
||||
const uiConfig = {};
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import VTooltip from 'v-tooltip';
|
|||
import vSelect from 'vue-select';
|
||||
import 'vue-resize/dist/vue-resize.css';
|
||||
|
||||
import '@shell/plugins/extend-router';
|
||||
// import '@shell/plugins/extend-router';
|
||||
import '@shell/plugins/formatters';
|
||||
import '@shell/plugins/vue-js-modal';
|
||||
import '@shell/plugins/js-yaml';
|
||||
|
|
|
|||
Loading…
Reference in New Issue