zoukankan      html  css  js  c++  java
  • vue 路由配置 和 react 路由配置

    vue的路由配置:router-link   router-view   this.$router.push   this.$router.params.query

    vue的路由守卫:全局路由守卫  beforeEach(to,from,next)    局部的路由守卫: beforeEnter(to,from,next)

    vue的路由鉴权:meta{isAutch:true:false}

    token   模拟  localStorage

    react的路由配置 NavLink  Route Switch  Redirect withRouter HasnRouter BorwerRouter  Link  exact

    路由参数:this.props.match,params.参数    this.props.history.push()

    路由守卫:render={()=>{reten <路由/>}}  简单守卫

    本篇文章持续更新详细内容

    react简单路由守卫 

    <Router>
        <Switch>
            <Route path='/mypage' render={()=>{
               retrun localStorage.getItem('username') ? <A /> : <Redirect to="login/">}}>
            <Route path='/login' component={Login}></Route>
        </Switch>
    </Router>
  • 相关阅读:
    CCNA 6.9
    CCNA 6.5
    Google search
    CCNA 4.14 TP Correction
    CCNA 6.3
    CCNA 6.6
    有关 英语学习的一些网站
    法语学习笔记
    垃圾邮件分类(Scala 版本)
    SQL 面试经典问题 行列互相转化
  • 原文地址:https://www.cnblogs.com/lrqcx/p/12145754.html
Copyright © 2011-2022 走看看