In my main app.js
, I set and define breakpoints by importing the VueMq package.
import VueMq from 'vue-mq';
Vue.use(VueMq, {
breakpoints: {
xsmall: 500,
small: 768,
medium: 1024,
large: 1360,
xlarge: 1800
}
});
I have bound it to Vue using Vue.use
, which should allow me to use the global $mq
in any component.
{{ $mq }}
However, when I try to access it globally, it only returns the default breakpoints (tablet, laptop) and not my custom ones.
If I reimport it in the component again, it works as expected, returning the strings like xsmall, small, etc.
import VueMq from 'vue-mq';
Vue.use(VueMq, {
breakpoints: {
xsmall: 500,
small: 768,
medium: 1024,
large: 1360,
xlarge: 1800
}
});
Is there a way to make it work globally without having to import it in every component?