getRouter function #

The getRouter function is a quick way to retrieve the router instance.

// import the function
import { getRouter } from 'https://cdn.skypack.dev/@ficusjs/router@3'

// use it within a component
createComponent('my-page-component', {
navigateTo (url) {
getRouter().push(url)
}
})