Vue
useAnchorProgress
Use `useAnchorProgress` composable
There are two ways to set up a progress bar that is triggered during navigation:
- If the framework has a router that detects the start and end of navigation, you can use the
useProgresscomposable to trigger the progress bar at the start of navigation and stop it when you reach the target page. - If the framework has a router that doesn't provide built-in navigation detection, you can use this
useAnchorProgresscomposable to activate navigation detection based on<a>elements in the DOM andwindow.history.
Import
Usage
Parameters
Options
| Prop | Type | Default |
|---|---|---|
shallowRouting | boolean | false |
disableSameURL | boolean | true |
startPosition | number | 0 |
delay | number | 0 |
stopDelay | number | 0 |
targetPreprocessor | (url: URL) => URL | undefined |
disableAnchorClick | boolean | false |
startOnLoad | boolean | false |
forcedStopDelay | number | 0 |