createRouter function

Create your router instance using the createRouter function passing an array of routes and an element selector as the router outlet:

// import the function
import { createRouter } from ''

// create list of routes
const routes = [
// routes defined here

const router = createRouter(routes, '#router-outlet')

When using the createRouter function, the following arguments can be passed:

routesArrayyesAn array of routes
rootOutletSelectorStringyesA CSS selector for the main router outlet
optionsObjectAn optional set of options. See options