literate-couscous

View the Project on GitHub posva/literate-couscous

Home > vue-router > createMemoryHistory

createMemoryHistory() function

Creates a in-memory based history. The main purpose of this history is to handle SSR. It starts in a special location that is nowhere. It’s up to the user to replace that location with the starter location.

Signature:

export default function createMemoryHistory(base?: string): RouterHistory;

Parameters

Parameter Type Description
base string Base applied to all urls, defaults to ‘/’

Returns:

RouterHistory

a history object that can be passed to the router constructor