Client Only Plugins

在此示例中:

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