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

代码如下

  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教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!