amanda-test
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "amanda-test", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,40 +0,8 @@ | ||
import { | ||
createRouter, | ||
createWebHashHistory, | ||
createWebHistory, | ||
RouteRecordRaw, | ||
} from "vue-router"; | ||
import VueRouter from "vue-router"; | ||
export const router = createRouter({ | ||
history: createWebHashHistory(), | ||
routes: [], | ||
}); | ||
const router = new VueRouter() | ||
/** | ||
* 注册路由 | ||
* @param routes 路由配置 | ||
*/ | ||
export const registerRoute = (routes) => { | ||
if (Array.isArray(routes)) { | ||
routes.forEach((route) => router.addRoute(route)); | ||
} else { | ||
router.addRoute(routes); | ||
} | ||
}; | ||
/** | ||
* 设置路由模式 | ||
* @param mode "hash" | "history" | ||
*/ | ||
export const setRouterMode = (mode) => { | ||
if (mode === "history") { | ||
router.options.history = createWebHistory(); | ||
} | ||
}; | ||
router.beforeEach((to, from, next) => { | ||
next(); | ||
}); | ||
export default router | ||
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
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
401
4
1