Vue · Senior · Question 42 of 75
How do guards handle async work like fetching permissions?
- ✓Correct answer: Guards can be
asyncfunctions; navigation waits for the returned Promise - 2Guards must be synchronous; use
setTimeoutfor async work - 3Async guards run after the component is mounted
Explanation
Keep guards fast or cache results - every navigation waits. The older next() callback style is still supported but returning values is recommended.