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.
Loading Sandbox...
Edit this page on GitHub Updated at Mon, Jul 12, 2021