AlexandreBonaventure / vue-mq

📱 💻 Define your breakpoints and build responsive design semantically and declaratively in a mobile-first way with Vue.
https://alexandrebonaventure.github.io/vue-mq
MIT License
537 stars 59 forks source link

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

Open jaxenvisuals opened 3 years ago

jaxenvisuals commented 3 years ago

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 commented 3 years ago

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?