Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tags-nav路由错误 #937

Closed
turbidsoul opened this issue Sep 1, 2018 · 1 comment
Closed

tags-nav路由错误 #937

turbidsoul opened this issue Sep 1, 2018 · 1 comment

Comments

@turbidsoul
Copy link

turbidsoul commented Sep 1, 2018

应该是turnToPage在路由的时候无法路由带参数的路由,例如edit/:id

因为这个方法在路由的时候使用的是name,但是name直接路由,是没有传入参数:id的。

这里我觉得可以直接是由地址路由,应该是能解决问题的

@turbidsoul
Copy link
Author

    turnToPage (item) {
      if (item.name.indexOf('isTurnByHref_') > -1) {
        window.open(item.name.split('_')[1]);
        return;
      }
      if('path' in item) {
        this.$router.push({
          path: item.path
        });
      } else {
        this.$router.push({
          name: item.name
        });
      }
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant