import {
	createRouter,
	createWebHashHistory
} from "vue-router";

const routes = [
	{
		path: "/",
		redirect: "/welcome"
	},
	{
		icon: "menuIcon el-icon el-icon-s-home", // 菜单所用 icon 
		path: "/welcome", // 菜单 path
		name: "首页", // 菜单显示的名称
		component: () => import("../views/test/page1.vue"),
		// children: [{
		// 	icon: "menuIcon el-icon el-icon-copy-document",
		// 	path: "page3",
		// 	name: "页面3",
		// 	component: () => import("../views/test/page3.vue"),
		// }]
	},
	{
		icon: "menuIcon el-icon el-icon-edit-outline",
		path: "/page2",
		name: "页面2",
		component: () => import("../views/test/page2.vue"),
	},
	{
		icon: "menuIcon el-icon el-icon-edit-outline",
		path: "/other",
		name: "其他",
		component: () => import("../views/test/page3.vue"),
		children: [{
			icon: "menuIcon el-icon el-icon-copy-document",
			path: "page3",
			name: "页面3",
			component: () => import("../views/test/page3.vue"),
		}]
	},
	{
		path: "/:catchAll(.*)",
		name: "404",
		component: () => import("../views/404.vue"),
	},
];

const router = createRouter({
	history: createWebHashHistory(),
	base: "/zhfx/",
	routes
});

// router.beforeEach((to, from, next) => {
	
// 	next();
// });

export default router;