Relying on key
attribute for QTd
causes quirks when wrapping a QTd
and using it in #body slot
#17830
Labels
area/components
bug/1-repro-available
A reproduction is available and needs to be confirmed.
flavour/quasar-cli-vite
kind/bug 🐞
Qv2 🔝
Quasar v2 issues
What happened?
When wrapping a
QTd
in a custom component and using it into aQTable
#body slot, we cannot rely on attrs inheritance askey
is handled as a special prop by Vue, causing the customQTd
to not display at allThis should only be the case when using
#body
slot to customizeQTr
too, as in all other cases thekey
attribute is automatically determined and set by Quasar itselfWhat did you expect to happen?
It should "just work"
Reproduction URL
https://stackblitz.com/edit/quasarframework-stackblitz-templates-gywz3vyd?file=src%2Fpages%2FIndexPage.vue
How to reproduce?
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Components (quasar)
Platforms/Browsers
No response
Quasar info output
Relevant log output
No response
Additional context
This is similar to the problem we had with
QTable
when we were usingdata
prop, which conflicted with Vue owndata
propertyIn that case it was a simple TS error, while in this case the problem happens at runtim
I'd suggest to use a prop to provide the column name to QTd (e.g.
name
) instead of relying on thekey
special attribute, automatically settingkey
to the new prop value insideQTd
(if possible)I don't think we can fix this without a breaking change, we need to wait for Qv3 release to fix it
In the repro I suggest a workaround to have it working in Qv2
The text was updated successfully, but these errors were encountered: