Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hack your Nuxt router!

andoshin11
December 11, 2019

Hack your Nuxt router!

Enhance your Nuxt application by extracting the router object and hacking it!
Here's how.

andoshin11

December 11, 2019
Tweet

More Decks by andoshin11

Other Decks in Technology

Transcript

  1. Routing in Nuxt.js • Place a file inside the pages

    directory • Instantly becomes a new route • Incredibly simple and easy! • However...
  2. By extracting router object • Easier to overlook route-meta •

    Easier to type-check • Easier to make a url-builder • Easier to generate breadcrumbs
  3. Tips: migrate from default router Step 1 $ nuxt build

    Step 2 router.js will be generated Step 3 Copy and paste contents