@flue3/router
Advanced tools
Comparing version 0.0.13-dev.0 to 0.0.14-dev.0
@@ -7,10 +7,12 @@ import { createRouter, createWebHistory, createMemoryHistory, } from 'vue-router'; | ||
import { createRoutesMiddleware } from './middleware/createRoutesMiddleware.js'; | ||
import { proceedUncertainModule } from 'flue3/lib/utils/proceedUncertainModule.js'; | ||
export * from 'vue-router'; | ||
export const createRouterPlugin = definePlugin(async ({ appContext, inject, onAfterEntry, }, options) => { | ||
const routes = await proceedUncertainModule(options.routes); | ||
const layouts = await proceedUncertainModule(options.layouts); | ||
const router = createRouter({ | ||
routes: [...options.routes, ...pluginRoutes], | ||
routes: [...routes, ...pluginRoutes], | ||
scrollBehavior: options.scrollBehavior, | ||
history: appContext.isServer ? createMemoryHistory() : createWebHistory(), | ||
}); | ||
const layouts = options.layouts ?? {}; | ||
inject('router', router); | ||
@@ -17,0 +19,0 @@ inject('layouts', layouts); |
@@ -8,5 +8,9 @@ import { Component } from 'vue'; | ||
export interface RouterPluginOptions { | ||
routes: RouteRecordRaw[]; | ||
layouts?: LayoutComponentsRecord; | ||
routes: (() => RouteRecordRaw[] | Promise<RouteRecordRaw[] | { | ||
default: RouteRecordRaw[]; | ||
}>) | RouteRecordRaw[]; | ||
layouts?: (() => LayoutComponentsRecord | Promise<LayoutComponentsRecord | { | ||
default: LayoutComponentsRecord; | ||
}>) | LayoutComponentsRecord; | ||
scrollBehavior?: RouterScrollBehavior; | ||
} |
{ | ||
"name": "@flue3/router", | ||
"version": "0.0.13-dev.0", | ||
"version": "0.0.14-dev.0", | ||
"description": "flue3 <head> tag manager plugin", | ||
@@ -5,0 +5,0 @@ "author": "FL3NKEY", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9583
230