Comments (8)
@mgreengithelps acctullay they forgot to add it in plugin for branch master
. Please check these two plugin file. Lastet Plugin, Master branch plugin
from vuetify-module.
Could be wrong, but it should not be available in plugins, per Nuxt Plugin page:
Nuxt.js allows you to define JavaScript plugins to be run before instantiating the root Vue.js Application. This is especially helpful when using your own libraries or external modules.
So if the Vue app is not instantiated yet, then I would suspect you would not be able to access $vuetify within any plugins.
from vuetify-module.
+1 I struggled with this for 5 hours yesterday, thought I was the bug...
from vuetify-module.
@eliyas5044 Is there any use case to use it in a plugin ? Please let me know, I'll do my best to make it accessible from context in both versions of the module (master
/ next
)
Indeed for now it should be accessible from context only on next
version through ctx.app.$vuetify
.
from vuetify-module.
@kevinmarrec sorry for late reply. This is necessary in context menu, if we want to localize vuetify. please check my use case. I used nuxt/i18n
for my localization. Now i want to change vuetify
local when i18n
change.
plugins/i18n.js
export default function({ app }) {
// onLanguageSwitched called right after a new locale has been set
app.i18n.onLanguageSwitched = (oldLocale, newLocale) => {
app.$vuetify.lang.current = newLocale;
};
}
or
export default function({ $vuetify}) {
// onLanguageSwitched called right after a new locale has been set
app.i18n.onLanguageSwitched = (oldLocale, newLocale) => {
$vuetify.lang.current = newLocale;
};
}
Thanks
from vuetify-module.
@eliyas5044 Alright I see, seems common use case, will fix that on both branches and will release new version soon
EDIT: It will be a bit tricky for Vuetify 1.5 as it's the Vuetify plugin that installs $vuetify
and not Nuxt itself, but should still be achievable.
EDIT2: Well for 2.0.0-beta.x it seems to be aswell Vuetify that registers $vuetify
too, it assumes that app.vuetify
(Vue options) is defined (which Nuxt module does).
In both versions, It seems $vuetify
is a little different, i'm afraid that we can't really bind it to context correctly
from vuetify-module.
@eliyas5044 If you're using 1.5, can you try this ?
Create a new plugin that does :
export default (ctx) {
ctx.$vuetify = Vue.prototype.$vuetify
}
Vue.prototype.$vuetify
is set by Vuetify installation (Vue.use(Vuetify)
)
or you can also even directly try :
export default function({ app }) {
// onLanguageSwitched called right after a new locale has been set
app.i18n.onLanguageSwitched = (oldLocale, newLocale) => {
app.vuetify.lang.current = newLocale;
};
}
app.$vuetify
does not exist butapp.vuetify
does.
from vuetify-module.
I've tried doing:
app.vuetify.framework.theme.themes.light.primary = obj
or
app.context.$vuetify.theme.themes.light.primary = obj
in /plugins/combined-inject.js. And calling the injected method in asyncData by
context.app.$colorsChangeVuetify({"base":"#FFA000","lighten1":"#6A1B9A"})
In other words: I'm trying to update Vuetify's light theme in asyncData.
But the color is not being updated in the Vuetify theme configuration. What I'm doing wrong? Thanks in advance!
from vuetify-module.
Related Issues (20)
- Object literal may only specify known properties, and 'vuetify' does not exist in type 'NuxtConfig'. HOT 2
- How can I use nuxt vuetify-module in specific layout and its pages?
- null model for v-tabs-items causes different output in SSR and client
- [BUG] Long load time in Chrome, hang in Firefox due to long icon loading HOT 8
- [BUG] The contents of v-card children are duplicated when an anchor tag is added HOT 3
- Installing problem on cpanel/nodevenv
- v-virtual-scroll component is missing HOT 1
- How to locally install material icons?
- Vue 2.7 compatibility HOT 3
- nuxt-bridge not being rendered on server side
- Cannot read properties of undefined (reading 'resolveAlias') with Nuxt3 HOT 2
- A v-form nested inside another v-form is a production silent bomb.
- Vuetify 3 release HOT 7
- vuetify not initialized HOT 1
- nuxtjs/vuetify (1.12.3) - Not working due to sass loader issue HOT 1
- Breadcrumbs component: clicking on the breadcrumb causes the site to rerender
- Module cases "JavaScript heap out of memory"
- Syntactically wrong css generation due to very old sass version
- Nuxt 3 Support HOT 8
- Need way to move vuetify-theme-stylesheet from top of head section to any position
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vuetify-module.