Skip to content

Types: RouterOptions

ts
type RouterOptions = object;

Options to initialize a Router instance.

Properties

PropertyTypeDescription
base?stringBase path to be prepended to any URL. Can be used for Vue applications that run in nested folder for domain. For example having base of /foo would assume all routes should start with your.domain.com/foo.
historyMode?RouterHistoryModeSpecifies the history mode for the router, such as "browser", "memory", or "hash". Default "auto"
initialUrl?stringInitial URL for the router to use. Required if using Node environment. Defaults to window.location when using browser. Default window.location.toString()
isGlobalRouter?booleanWhen false, createRouterAssets must be used for component and hooks. Assets exported by the library will not work with the created router instance. Default true
prefetch?PrefetchConfigDetermines what assets are prefetched when router-link is rendered for a specific route
rejections?RejectionsComponents assigned to each type of rejection your router supports.
removeTrailingSlashes?booleanRemoves trailing slashes from the URL before matching routes. The browser's url is updated to reflect using router.replace. Default true