Client Only Plugins
In this example we show how to use a plugin so that it is only available on the client side
In this example:
plugins/client-only.client.js
uses the window.alert()
function which is not available on server side.
nuxt.config.js
contains the plugins
property which registers the plugin on the client side by adding the .client
extension.
Learn more in the Directory Structure book in the plugins chapter.
Loading Sandbox...
Edit this page on GitHub
Updated at Mon, Jul 12, 2021