zoukankan      html  css  js  c++  java
  • Vue路由重定向

    欢迎一起讨论

    Geooo的个人博客:https://geooo.gitee.io/geoooblog/

    • Vue路由对象:$router
    • 路由跳转方法: push( )
    • 实现:$router.push('url')

    方法一:我们可以自己先建一个路由对象,调用 push() 方法进行跳转

    myrouter.push(' 重定向的path ')
    




    方法二:在方法体中加入钩子函数:

    confirmPasswd (passwd) {
          if (passwd === '123456') {
            // this.showSuccessAlert('success', 'default')
            //密码正确
            this.$router.push({
              name: 'zdws-index'
            })
    
          } else {
            this.showErrorAlert('primary', 'default')
          }
        }
    

    待添加...Continue...

  • 相关阅读:
    py 5.11
    py 5.10
    py 5.9
    py 5.8
    python 5.7
    python 5.4
    python 5.3
    python 5.2
    python 4.28
    python 4.27
  • 原文地址:https://www.cnblogs.com/Geooo/p/11279490.html
Copyright © 2011-2022 走看看