Nuxtjs Cheat Sheet
Nuxtjs Cheat Sheet
Nuxtjs Cheat Sheet
Pages
Routing
Pages with Layout Dynamic Route
e.g.
layouts/default.vue /about
[foo].vue params:
<template> {foo: "about"}
<div>
<nav> Mixed Route
<NuxtLink to="/">Home</NuxtLink> e.g.
<NuxtLink to="/about">About</NuxtLink> /my-inventory
</nav> my-[foo].vue params:
<main> {foo: "inventory"}
the page content
<slot />
</main> will appear here Optional Route
</div> e.g.
</template> /
[[foo]].vue params:
{foo: ""}
app.vue pages/index.vue
Catch-All Route
<template> <template> e.g.
<NuxtLayout> <h1>Home</h1> /profile/image
<NuxtPage /> ...
</NuxtLayout> </template> [...foo].vue params:
</template> {foo: ["profile","image"]}
{ swr: 60 }