【知识点】在学习

  • Set数据结构

    1. 成员的值都是唯一的,没有重复
    2. const s = new Set();
    3. Array.form()将set结构转为数组
      数组去重
      function dedupe(arr){ return Array.form(new Set(arr)); }
  • 数组方法

    • map遍历数组中的每个元素执行指定的函数 let a = arr.map(x => x*2 )
  • 解构赋值
    扩展运算符(...)用于解构赋值,只能放最后一位
    let { p, ...param} = obj

    • 数组根据顺序匹配,对象的解构根据属性名匹配
    let config = { host: 'localhost', 
    port: '3306',
    user: 'root',
    password: '123456',
    database: 'mypoem',
    connectTimeout: 5000
    };
    const { host, user, password, database } = config;
    
  • 模板字符串( ` ` )

  • 使用路由进行页面跳转
    this.$router.push({ path: "/"})
    会向history添加记录,使用this/$router.go(-1) 会后退一步
    this.$router.replace({ path: "/"})
    不会向history添加记录,是直接替换当前的history记录

  • import export

posted @ 2020-12-22 09:52  羲兮cf  阅读(72)  评论(0编辑  收藏  举报