viewweiwu / vue-tabs-chrome

chrome tab like.
https://viewweiwu.github.io/vue-tabs-chrome/
232 stars 48 forks source link

window is not defined #58

Closed boomermath closed 2 years ago

boomermath commented 2 years ago

When importing vue-tabs-chrome into my nuxt app, I get an error message saying window is not defined, and it can be traced back to the minified file in the npm package.

boomermath commented 2 years ago

I am using the code from the example in the README by the way

viewweiwu commented 2 years ago

Thank you very much for using it.

To use vue-tabs-chrome inside Nuxt, you need to register plugins.

// plugins/vue-tabs-chrome.js

import Vue from "vue";
import VueTabsChrome from "vue-tabs-chrome";

Vue.use(VueTabsChrome);
// nuxt.config.js

 plugins: [{ src: "~/plugins/vue-tabs-chrome.js", mode: "client" }],

https://go.nuxtjs.dev/config-plugins

boomermath commented 2 years ago

This works perfectly, thank you so much for your help!