Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VueMq($mq) computed value is not reactive when using Nuxt. #73

Open
jaxenvisuals opened this issue Jul 30, 2021 · 1 comment
Open

VueMq($mq) computed value is not reactive when using Nuxt. #73

jaxenvisuals opened this issue Jul 30, 2021 · 1 comment

Comments

@jaxenvisuals
Copy link

jaxenvisuals commented Jul 30, 2021

When I resize the browser window, the value for $mq remains the same. But in the demo, it is reactive.
Here's my code below:

plugins/vue-mq.js
`import Vue from 'vue'
import VueMq from 'vue-mq'

// Vue MQ
Vue.use(VueMq, {
breakpoints: {
// default breakpoints - customize this
sm: 640,
md: 768,
lg: 1024,
xl: 1280,
xxl: 1440,
},
defaultBreakpoint: 'sm', // customize this for SSR
})
`

nuxt.config.js
plugins: [{ src: '~plugins/vue-mq.js', ssr: false }],

@jaxenvisuals jaxenvisuals changed the title VueMq is not reactive when using Nuxt. VueMq($mq) computed value is not reactive when using Nuxt. Jul 30, 2021
@jaxenvisuals
Copy link
Author

So I just realized that the moment I used this.$mq in a computed property, it became reactive. I was only watching it from the vue browser inspector. Is this a bug or a normal flow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant