路由跳转到另一个页面

点击添加员工跳转到详情页

 <el-button size="mini" type="primary" @click="$router.push('/employee/detail')">添加员工el-button>

配置员工详情的路由信息

import layout from "@/layout";
export default {
  path: "/employee",
  component: layout,
  children: [
    {
      path: "",
      name: "employee",
      component: () => import("@/views/employee"),
      meta: {
        title: "员工",
        icon: "people",
      },
    },
    {
      path: "/employee/detail", // 员工详情的地址
      component: () => import("@/views/employee/detail.vue"),
      meta: {
        title: "员工详情", // 显示在导航的文本
      },
      hidden: true, // 表示隐藏在左侧菜单
    },
  ],
};

跳转的详情页面 @/views/employee/detail.vue

<template>
   <div>哈哈哈哈div>
template>

路由跳转到另一个页面_第1张图片

你可能感兴趣的:(javascript,前端)