Skip to content

[vue] 在vue组件中怎么获取到当前的路由信息? #377

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

[vue] 在vue组件中怎么获取到当前的路由信息?

Activity

miqidian

miqidian commented on Aug 6, 2019

@miqidian

this.$router.path 或者 this.$router

Real102

Real102 commented on Sep 27, 2019

@Real102

this.$router.path 或者 this.$router

是this.$route.path吧

liuxiaoyang1

liuxiaoyang1 commented on Nov 19, 2019

@liuxiaoyang1

this.$router.path 或者 this.$router

是this.$route.path吧

对,

zlqGitHub

zlqGitHub commented on Dec 23, 2019

@zlqGitHub

如果是template中获取直接 $route 即可
如果是script中获取 this.$route
可以 console.log(this.$route) 查看其详细信息

WenJieLi1998

WenJieLi1998 commented on Apr 19, 2020

@WenJieLi1998

this.$route

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @miqidian@haizhilin2013@Real102@WenJieLi1998@liuxiaoyang1

        Issue actions

          [vue] 在vue组件中怎么获取到当前的路由信息? · Issue #377 · haizlin/fe-interview