zoukankan      html  css  js  c++  java
  • 导航守卫

    to  准备跳转到哪个页面

    from 从哪个页面中离开

    next  函数

    全局守卫

    router.beforeEach((to,from,next) => {
       if(to.path == '/login' || to.path == '/register'){
        next(); }else{
        alert('先登录')
        next('/login') } })

    组件守卫

    data () {
      return{
        name: 'zuo'
      }
    }
    beforeRouteEnter:(to, from, next) => {
      next(vm => {
        alert("123" + name)
      })
    }
    beforeRouteEnter:(to, from, next) => {
      if(confirm("确认离开吗")){
        next();
      }else{
        next(false)
      }
    }
  • 相关阅读:
    UVa 106
    UVa 111
    UVa 105
    UVa 104
    UVa 103
    UVa 102
    UVa 101
    UVa 100
    就决定是你了!
    阿姆斯特朗回旋加速喷气式阿姆斯特朗炮
  • 原文地址:https://www.cnblogs.com/dreamMargin/p/10536562.html
Copyright © 2011-2022 走看看