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

在组件生命周期钩子函数里怎么拿到请求参数? #56

Closed
PeakTai opened this issue Jul 15, 2015 · 1 comment
Closed

在组件生命周期钩子函数里怎么拿到请求参数? #56

PeakTai opened this issue Jul 15, 2015 · 1 comment

Comments

@PeakTai
Copy link

PeakTai commented Jul 15, 2015

router.map({
    "/user/:userId":{
        template:"省略",
        created: function () {
            //在这里怎么拿到userId
        }
    }
})
@yyx990803
Copy link
Member

你的用法有一点问题,这里不能直接给一个组件对象,因为这里是一个 route config。组件要放在 component 选项里。

当前 route 在组件里可以用 this.route 对象,上面有 path, paramsquery 等信息。

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

2 participants