You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use it in Nuxt but it fails on "window is not defined". Without it (defined as client-only) it fails on: "matchMedia is not defined" because my core uses it.
I would load it like this:
import Vue from 'vue'
import vMediaQuery from 'v-media-query'
if (process.browser) {
Vue.use(vMediaQuery)
}
else {
// Use mockup
}
What to put in the else section? Some mockup what can be used in components but always will pass (so it will be rendered).
The text was updated successfully, but these errors were encountered:
Hi, of course u can make PR.
But you shouldn't use process.browser for check enviroment, because process available only if u use webpack or something like.
I think we should add guard for check window and addEventListener, matchMedia methods.
I tried to use it in Nuxt but it fails on "window is not defined". Without it (defined as client-only) it fails on: "matchMedia is not defined" because my core uses it.
I would load it like this:
What to put in the
else
section? Some mockup what can be used in components but always will pass (so it will be rendered).The text was updated successfully, but these errors were encountered: