替换var 为const/let

删除未使用import
替换 == 为 ===
This commit is contained in:
xingyu4j
2022-11-08 13:31:08 +08:00
parent c9e11e7636
commit 011dc23699
66 changed files with 305 additions and 319 deletions

View File

@ -69,7 +69,7 @@ export default {
childrenMenus() {
const childrenMenus = [];
this.routers.map((router) => {
for (var item in router.children) {
for (let item in router.children) {
if (router.children[item].parentPath === undefined) {
if(router.path === "/") {
router.children[item].path = "/" + router.children[item].path;
@ -135,10 +135,10 @@ export default {
},
// 当前激活的路由
activeRoutes(key) {
var routes = [];
const routes = []
if (this.childrenMenus && this.childrenMenus.length > 0) {
this.childrenMenus.map((item) => {
if (key == item.parentPath || (key == "index" && "" == item.path)) {
if (key === item.parentPath || (key === "index" && "" === item.path)) {
routes.push(item);
}
});