- 博客(3)
- 收藏
- 关注
原创 Array.reduce()方法
Array.reduce()方法是对数组的遍历,返回一个单个返回值使用方法:Array.reduce((acc,cur,idx,src)=>{},initialValue)callback回调函数接收4个参数:Accumulator(acc)(累计数)如果传入了initialValue,Accumulator的初始值就是initialValue,没传入就是数组的第一个值Current Value (cur) (当前值)Current Index (idx) (当前索引)如果
2022-02-20 10:51:28
918
原创 组件通信(父传子,子传父,兄弟传值)
一、父传子父组件:<son :msg=“fatherMsg”></son>子组件:props:[‘msg’]//父组件<template> <div> <son :msg="fatherMsg"></son> </div></template><script>import son from './son'export default { da...
2022-02-16 11:01:32
269
原创 Element-ui中menu使用sessionStorage保存选中状态
使用sessionStorage使刷新后页面选中状态不变menu中设置绑定事件,存入sessionStorage取出sessionStorage中的值,赋给:default-active
2022-02-13 14:32:31
426
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅