Nuxt Helpers
Using the $nuxt helpers with $nuxt.isOnline, renderedOn, refresh(), onNuxtReady
In this example:
pages/index.vue
shows:
-
$nuxt.isOnline
and$nuxt.isOffline
- tells the user if they are online or offline. -
renderedOn
- prints a message telling us if the page is rendered on the server or client. -
$nuxt.refresh()
- refreshes data without refreshing the page.
plugins/nuxt-ready.client.js
shows:
-
window.onNuxtReady
- logs a message to the console when Nuxt is ready.
Learn more in the Concepts book in the Context and Helpers chapter.
Loading Sandbox...
Editer cette page sur GitHub
Mise à jour le Mon, July 12, 2021