主键中调用vue-router的push方法跳转页面无反应?
高洛峰
高洛峰 2016-10-29 09:37:12
0
1
1679

代码如下

  methods: {
    ...mapActions(['doLogin']),
    login() {
      this.doLogin({ username: this.username, password: this.password }).then((loginInfo) => {
        if (loginInfo.error === 200) {
          console.log('登录成功');
          if (this.$route.query.redirect !== undefined) {
            this.$router.push(this.$route.query.redirect);
          } else {
            this.$router.push('/index');
          }
        } else {
          console.log(loginInfo.msg);
        }
      });
    },
  },

登录成功有打出来,但是页面静止没有跳转,也没有报错

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!