Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Hack your Nuxt router!
Search
andoshin11
December 11, 2019
Technology
0
1.2k
Hack your Nuxt router!
Enhance your Nuxt application by extracting the router object and hacking it!
Here's how.
andoshin11
December 11, 2019
Tweet
Share
More Decks by andoshin11
See All by andoshin11
Envoy External AuthZとgRPC Extensionを利用した「頑張らない」Microservices認証認可基盤
andoshin11
0
240
カーナベル株式会社2024年2月 エンジニアイベント資料
andoshin11
0
110
Private Cloudを支える最高のユーザーガイド運用技術
andoshin11
0
260
TS CompilerがVueを喋れても良いじゃないか
andoshin11
0
680
ain't giving up type-safe Express
andoshin11
2
400
Type Safe "Everything"
andoshin11
0
220
GatewayパターンとSchema駆動開発
andoshin11
8
1.3k
Catch up Nuxt.js 2019.02
andoshin11
0
1.9k
The future of Nuxt.js with TypeScript
andoshin11
0
79
Other Decks in Technology
See All in Technology
どこよりも遅めなWinActor Ver.7.5.0 新機能紹介
tamai_63
0
190
AIで変わるテスト自動化:最新ツールの多様なアプローチ/ 20240910 Takahiro Kaneyama
shift_evolve
0
210
Functional TypeScript
naoya
11
4.7k
20240911_New_Relicダッシュボード活用例
speakerdeckfk
0
100
2024年のナビゲーション・フォーカス対応:Composeでキーボード・ナビゲーションをサポートしよう
tahia910
0
110
Next.js のページ遷移を全力で止める
ypresto
1
840
DroidKaigi 2024 たすけて!ViewModel
mhidaka
5
880
Creative UIs with Compose: DroidKaigi 2024
chrishorner
1
470
効果的なオンコール対応と障害対応
ryuichi1208
5
2.9k
Javaにおける関数型プログラミンへの取り組み
skrb
7
320
ロリポップ! for Gamersを支えるインフラ/lolipop for gamers infrastructure
takumakume
0
130
20240912 JJUGナイトセミナー
mii1004
0
140
Featured
See All Featured
Speed Design
sergeychernyshev
22
430
Building Adaptive Systems
keathley
36
2.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
157
15k
Principles of Awesome APIs and How to Build Them.
keavy
125
16k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
663
120k
Atom: Resistance is Futile
akmur
261
25k
No one is an island. Learnings from fostering a developers community.
thoeni
18
2.9k
Unsuck your backbone
ammeep
667
57k
Docker and Python
trallard
39
3k
Art, The Web, and Tiny UX
lynnandtonic
294
20k
Producing Creativity
orderedlist
PRO
340
39k
Agile that works and the tools we love
rasmusluckow
327
20k
Transcript
Hack your Nuxt router! @andoshin11 Sample Code :https://github.com/andoshin11/studio-andy/pull/119
Routing in Nuxt.js • Place a file inside the pages
directory • Instantly becomes a new route • Incredibly simple and easy! • However...
By extracting router object • Easier to overlook route-meta •
Easier to type-check • Easier to make a url-builder • Easier to generate breadcrumbs
Using router module @nuxtjs/router
Quick Setup! • Install router-module
Quick Setup! • Install router-module • Register the module
Quick Setup! • Install router-module • Register the module •
Create router file
Tips: migrate from default router Step 1 $ nuxt build
Step 2 router.js will be generated Step 3 Copy and paste contents
Override RouteMeta type def
Making url-builder (preparation) • First we need a route resolver
to retrieve the entire ancestors
Making url-builder
Generate Breadcrumbs
Generate Breadcrumbs
Generate Breadcrumbs
Generate Breadcrumbs
Thank you!