Open mostafa7904 opened 2 years ago
Look in your developer console in the browser, its probably related to Hydration issues like mine was. The actual fix for me on Nuxt 3 was to disable ssr in my nuxt.config.js
ssr: false,
This is the thing. I need to use SSR.
The HTML Spec does not allow a div
to be inside an anchor
tag, and will auto-close directly when encountering one.
Then Vue tries to hydrate will see that the DOM is not as it should, give a warning and try to correct itself but without removing the extra nodes.
Maybe using span
s instead of div
s with display: block
would help?
Actually what I've noticed is that i can not put an anchor inside another anchor, some thing like that : <a> <div> some text </div> <a>Anchor</a> </a>
and if you see at the implementation of v-card
you can figure that is an anchor element.
So, yeah to avoid that using span
instead of divs with
display: block` will help (https://github.com/nuxt-community/vuetify-module/issues/499#issuecomment-1502991847)
All the packages version:
The contents of
v-card-*
is duplicated when the link and href attributes are present on the parentv-card
and there is an anchor tag inv-card-*
.To Reproduce Github repo to reproduce the bug Just run the project and you will see the bug.
Steps to reproduce the behavior:
v-card
element to your pagev-card
componentv-card-text
orv-card-subtitle
orv-card-actions
Expected behavior The contents of
v-card-text
andv-card-actions
should not be duplicated.Screenshots
Additional context This bug only appears in Nuxt so I thought this would be the repo to report this issue, if you reckon it's Vuetify's issue I will open the same issue in Vuetify's repo.
The anchor tag has to be in one of v-card child components (
v-card-text
, ...).If you don't see the duplicate content, refresh the page.