Bot releases are visible (Hide)
Published by Atinux almost 8 years ago
redirected
key in the result of nuxt.renderRoute(route, context = {})
, useful for unit testsredirect
field in the context
received in data (context)
and fetch (context)
, useful for authenticated routes:// Ex: dashboard.vue
<script>
export default {
fetch ({ redirect, route }) {
// Check if user is connected via req.session or JWT...
redirect({
path: '/login',
query: { redirect: route.fullPath }
})
}
}
</script>
You can also use redirect('/login')
if you don't want to add any query parameter.
The redirect also works for nuxt generate
and will create a html page with:
<meta http-equiv="refresh" content="0; url={{ redirectedPath }}" />
<script type="text/javascript">
window.location.href = '{{ redirectedPath }}'
</script>
Published by Atinux almost 8 years ago
_build
and _renderer
options to control the start of the renderer and the build process when instantiating Nuxt(options)
router.base
is setpath.join
to join url paths (on Windows, will be joined by a \
)Published by Atinux almost 8 years ago
router.routes
, see examples/custom-routes/
router
object to cutomise vue-router
options: base
and linkActiveClass
Published by Atinux almost 8 years ago
Published by Atinux almost 8 years ago
nuxt generate
to generate a static website with nuxt.jsPublished by Atinux almost 8 years ago
.vue
file is added or removed (using chokidar)nuxt.stop()
to nuxt.close()
to stop watching files on dev build (used by most libraries)use strict
in every js files of nuxtPublished by Atinux almost 8 years ago
./static/
folder is now mapped to /
, this to allows to have robots.txt
files or sitemap.xml
, since there is no main reason to not map it to /
nuxt.renderRoute(route, context)
send back an object with html
and error
instead of the htmlstatic
folder from its render(req, res)
function (instead of the server used by nuxt-dev and nuxt-start), this to keep consistency in the behaviour of nuxtwith-ava
example to check when the app sent back an error from the serverPublished by Atinux almost 8 years ago
nuxt build
-> Build only the applicationnuxt start
-> Launch the server and nuxt (without building it, so make sure to launch nuxt build before)dev
option to specify if the build will be for production or development, define also the webpack-dev-middleware and hot-reloading for nuxt-dev
Published by Atinux almost 8 years ago
Move repository to nuxt organization
window.onNuxtReady
Published by Atinux almost 8 years ago
build
field in the nuxt options (available in nuxt.config.js), see examples/custom-build/
plugins
options to load given files before loading the vues.js application (see example)Published by Atinux almost 8 years ago
Published by Atinux almost 8 years ago