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

代码如下

  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學習者快速成長!