Is there a way to access $vuetify (and any other added globals) in the settings function? Is there a way to give composables access to it?
... setup() { const { isDesktop } = $vuetify.breakpoints.mdAndUp; // <=== how to get $vuetify return { isDesktop }; },
Can be combined to obtain vuetify instances:
// useVuetify.ts import { getCurrentInstance } from 'vue' export function useVuetify() { const instance = getCurrentInstance() if (!instance) { throw new Error(`useVuetify should be called in setup().`) } return instance.proxy.$vuetify }Import it into your component:
If you are using Vue @vue/composition-api instead of Vue 2.7, please replace
'vue'with'@vue /composition-api'