Cheaterman
Cheaterman
NNuxt
Created by Cheaterman on 8/7/2024 in #❓・help
Weird :key behavior
I'm having a SUPER WEIRD issue with :key - I get some fairly random ordering of items if I use :key="mything.id" (id is a PK straight from DB so very much unique) but it works with :key="index" (in v-for="(mything, index) in mythings" - mythings being computed if that's relevant)
1 replies
NNuxt
Created by Cheaterman on 8/5/2024 in #❓・help
Conditional :ui
Bliblibli buddiez I hope y'all doing goodie!
<USelect
:ui="{
color: {
gray: {
outline: (
'focus:ring-blue-500'
+ (selectedState === 2 ? ' bg-red-300' : '')
)
},
},
rounded: 'rounded-none'
}"
>
<USelect
:ui="{
color: {
gray: {
outline: (
'focus:ring-blue-500'
+ (selectedState === 2 ? ' bg-red-300' : '')
)
},
},
rounded: 'rounded-none'
}"
>
Currently I'm doing something like this to conditionally set the background, but it feels a bit icky to be doing string formatting (needing that leading space etc) for this, is there maybe a better way? Thanks in advance!
3 replies