zoukankan      html  css  js  c++  java
  • 关于简化代码-路由切换

    <el-menu
              :default-active="element.active"
              :router="element.router"
            >
              <el-menu-item style="margin-left: 150px;" index="/index">首页</el-menu-item>
              <el-menu-item style="margin-left: 20px;" index="/problem">问题</el-menu-item>
              <el-menu-item style="margin-left: 20px;" index="/state">状态</el-menu-item>
              <el-menu-item style="margin-left: 20px;" index="/hmwklist">作业</el-menu-item>
              <el-menu-item style="margin-left: 20px;" index="/examlist">考试</el-menu-item>
              <el-menu-item style="margin-left: 20px;" index="/faq">FAQ</el-menu-item>
    </el-menu>
     
    export default {
      data() {
        return {
          element: {
            //是否只保持一个子菜单的展开
            opened: true,
            //是否使用 vue-router 的模式
            //启用该模式会在激活导航时以 index 作为 path 进行路由跳转
            router: true,
            //当前激活菜单的 index
            active: "/problem"
          },
    }
    }
     
  • 相关阅读:
    poj 2253
    POJ 3273
    python基本运算符
    python基本数据类型以及常量变量
    pycharm的快捷键
    计算机基础
    day100 scrapy请求传参 中间件 去重规则 分布式爬虫
    day99 爬虫 scrapy介绍 结构介绍
    day98 爬虫 selenium
    day97 爬虫bs4
  • 原文地址:https://www.cnblogs.com/lsyy2017/p/14260589.html
Copyright © 2011-2022 走看看