default-active的使用

default-active需要传进去的值就是子导航的index值(也就是其路由值),达到点击路由就可以引起高亮。

1.首先是在index处动态接收api里面的路由名称 2.然后点击事件时用函数获取路由名称

<!-- 二级菜单 -->
            <el-menu-item
            :index="'/' + items.path" 
            //首先是在index处动态接收api里面的路由名称
            v-for="items in item.children"
            :key="items.id"
            @click="activeItem('/' + items.path)" 
            //然后点击事件时用函数获取路由名称
            >

3.点击时,通过函数将路由值保存到本地,同时再created里面申明

activeItem (path) {
      window.sessionStorage.setItem('activePath', path)
      this.activePath = path
    }
created () {
    this.activePath = window.sessionStorage.getItem('activePath')
  }

4.然后将本地的路由值动态的传给default-active

<el-menu :default-active="activePath"></el-menu>

注:

1.sessionStorage 属性允许你访问一个,对应当前源的 session Storage对象。它与  localStorage相似,不同之处在于 localStorage 里面存储的数据没有过期时间设置,而存储在 sessionStorage 里面的数据在页面会话结束时会被清除。

语法:

// 保存数据到 sessionStorage
sessionStorage.setItem('key', 'value');

// 从 sessionStorage 获取数据
let data = sessionStorage.getItem('key');

// 从 sessionStorage 删除保存的数据
sessionStorage.removeItem('key');

// 从 sessionStorage 删除所有保存的数据
sessionStorage.clear();

2.created什么时候使用

vue.js中created方法是一个生命周期钩子函数,一个vue实例被生成后会调用这个函数。data与methods已经初始化,但是还没有编译模板。–【请求数据】

一个vue实例被生成后还要绑定到某个html元素上,之后还要进行编译,然后再插入到document中。每一个阶段都会有一个钩子函数,方便开发者在不同阶段处理不同逻辑。

create方法,在页面还未渲染成html前,调用函数,从后端获取数据,在实现对页面的数据进行显示

  • 6
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
README.TXT NOTES ON MS-DOS VERSION 5.0 =========================== In this file the following topics are covered: 1. Introduction 2. Solving Setup Problems 2.1 Priam and Everex Hard Disks 2.2 SyQuest Removable Hard Disk 2.3 Bernoulli Drive 2.4 Disk Manager 2.5 SpeedStor and Volume Expansion 2.6 Novell Partitions 2.7 Vfeature Deluxe 2.8 Columbia Data Systems Device Driver 2.9 Incompatible Partition 2.10 WYSE Partitions 2.11 286 Accelerator Cards 2.12 Bernoulli Cache 2.13 AT&T 6300 Computers 2.14 LANtastic 2.15 Western Digital SCSI Hard-Disk Controllers 2.16 Change CONFIG.SYS File 2.17 Toshiba T1600 and a Hard RAM Disk 3. Installing MS-DOS 5.0 on OS/2 Systems 3.1 Installing MS-DOS 5.0 and OS/2 Dual-Boot Systems 3.2 Using the Uninstall Program on an OS/2 System 4. Solving Memory Problems 4.1 386MAX 4.2 All Computers Expanded-Memory Driver 4.3 Bus Master DMA Controller 4.4 HIMEM.SYS Location 4.5 INT15 Access to Extended Memory 4.6 Intel LIM Driver 4.7 Phoenix BIOS and HIMEM.SYS 4.8 QEMM 4.9 XMAEM.SYS and XMA2EM.SYS 5. Solving Problems with Windows 5.1 DOS Applications in Windows Enhanced Mode 5.2 EMM386.EXE Location 5.3 WINA20.386 File 5.4 Windows 3.0 Enhanced Debug Version 5.5 Windows 2.03 5.6 Windows/286 2.1 5.7 Windows 386 and the Upper Memory Area 6. Making Your Hardware Compatible with MS-DOS 5.0 6.1 101-key Keyboards and QBasic/MS-DOS Editor 6.2 Acer 1100/33 6.3 Adaptec Controller Boards 6.4 Amstrad Systems and KEYB.COM 6.5 Hardcard II 6.6 COMPAQ EXTDISK.SYS Driver 6.7 Corel System Drivers 6.8 External Disk Drives 6.9 Mice and MS-DOS Shell 6.10 NCR VGA BIOS 6.11 Olivetti Systems 6.12 Toshiba T3100SX 6.13 Western Digital VGA Card 6.14 Zenith Computers 7. Making Your Network Compatible with MS-DOS 5.0 7.1 3+Share 7.2 AT&T StarGROUP 7.3 DCA 10Net and Word5 7.4 DOS LAN Requester 7.5 I

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值