You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, just started to use this package and it seems quite nice.
But I noticed a isse on my code and not sure if depending on my code, this package or nuxt logic itself and I would liek to ask some help.
Here a description of my issue (steps):
I've installed the package following the documentation. All is fine.
Because I want to use the "no-js / js class" logic for setting a class on html element (the "setClasses" option from Modernizr itself), I did the following: set the option as shown on package documentation, then added 'no-js' class to the html tag from nuxt config file, as following:
``
head: {
...
htmlAttrs: {
class: 'no-js',
},
...
}
``
Also here all was fine.
Page is loaded, and class "no-js" added on DOM (by Nuxt htmlAttrs). Then JS on client is loaded, also Modernizr, and class "no-js" is changed to class "js" by Modernizr.
Then here the issue: on a page (call this page "subpage") I've decided to overwrite, in the page itself by the method "head", the title of the page.
This is working, but as side effects I've noticed that when I navigate from the homepage to the "subpage", the no-js/js class set by modernizr is kind of "reset".
My possible explanation
After several tests, it seems that the setClasses logic is kind of 'reset' any time in a Vue page or Vue component I set the "head" property and try to overwrite ANY options in it (at page change).
In this way the Modernizr "setClasses" logic (what I use to call "no-js / js class trick") seems crashing or at least reset to the value set in nuxt config file (".no-js").
My question
Anyone experienced this issue? is this an issue related to this package, or to Nuxt logic in general?
Could anyone support me on this issue?
Hi, just started to use this package and it seems quite nice.
But I noticed a isse on my code and not sure if depending on my code, this package or nuxt logic itself and I would liek to ask some help.
Here a description of my issue (steps):
I've installed the package following the documentation. All is fine.
Because I want to use the "no-js / js class" logic for setting a class on html element (the "setClasses" option from Modernizr itself), I did the following: set the option as shown on package documentation, then added 'no-js' class to the html tag from nuxt config file, as following:
``
head: {
...
}
``
Also here all was fine.
Page is loaded, and class "no-js" added on DOM (by Nuxt htmlAttrs). Then JS on client is loaded, also Modernizr, and class "no-js" is changed to class "js" by Modernizr.
This is working, but as side effects I've noticed that when I navigate from the homepage to the "subpage", the no-js/js class set by modernizr is kind of "reset".
My possible explanation
After several tests, it seems that the setClasses logic is kind of 'reset' any time in a Vue page or Vue component I set the "head" property and try to overwrite ANY options in it (at page change).
In this way the Modernizr "setClasses" logic (what I use to call "no-js / js class trick") seems crashing or at least reset to the value set in nuxt config file (".no-js").
My question
Anyone experienced this issue? is this an issue related to this package, or to Nuxt logic in general?
Could anyone support me on this issue?
I've also set a test repo where I've set some basic code as documentation here:
https://github.com/valeriosillari/nuxt-modernizr-test
The text was updated successfully, but these errors were encountered: