Nuxt Helpers

在此示例中:

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 reday.

Learn more in the Concepts book in the Context and Helpers chapter.

Loading CodeSandbox...