Shahadat Hossain
Shahadat Hossain

Reputation: 979

Is it posible having an optional vue route

In my vue application I need an optional router like this

#/profile/(:user/)?task/current-task

Here I want user will be optional. if user not exit then I want to show current login user task. I know #/profile/(:user/)? it possible. But having children after an optional params not working for me. any suggestion?

Upvotes: 1

Views: 245

Answers (1)

ittus
ittus

Reputation: 22403

It's possible

You can define #/profile/:user?/task/current-task

Demo

http://jsfiddle.net/29jvk913/

More nested params

http://jsfiddle.net/y3kbovhy/

Upvotes: 1

Related Questions