Can we access $vuetify in Pinia? #1055
Unanswered
Sjoerd82
asked this question in
Help and Questions
Replies: 1 comment 1 reply
-
for vue2 you could create a global mixin and use a computed isMobile... return this.$vuetify... mixins/isMobile.js export default {
computed: {
isMobile() {
return this.$vuetify.breakpoint.mobile
}
}
} and in main.js or hoo ever its called |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I use
this.$vuetify.breakpoint.mobile
on a lot of pages throughout my application, and would love to centralize it as a reusable computed variable. I recently have incorporated Pinia in my app. Would be great if this could be in a getter. Something like:However, I'm not sure if this.$vuetify is accessible here (so far was not able to get to it).
I'm on Vue2 (because of Vuetify not being ready for Vue3 yet) + the Composition API plugin for Vue2, in case that matters.
Beta Was this translation helpful? Give feedback.
All reactions