Skip to content

[UDropdown] item.class no longer applied in v2.11.1 #1157

@XStarlink

Description

@XStarlink

Environment

  • Nuxt 3.8.2
  • Nuxt UI 2.11.1

Version

2.11.1

Reproduction

<template>
  <UDropdown
    :items="actions"
    :ui="{ width: 'w-40' }"
    :popper="{ placement: 'right-start' }"
  >
    <v-icon icon="i-lucide-more-horizontal" size="small" />
  </UDropdown>
</template>

<script setup>
const actions = [
  [
    {
      label: 'Edit',
      icon: 'i-lucide-pen-square',
      click: () => {}
    },
    {
      label: 'Share',
      icon: 'i-lucide-share',
      disabled: true,
      click: () => {}
    }
  ],
  [
    {
      label: 'Delete',
      class: '!text-red-500',
      icon: 'i-lucide-trash-2',
      iconClass: 'text-red-500',
      click: () => {}
    }
  ]
]
</script>

Description

Hello thanks for this great lib,
In my project I used to style some dropdown items with 'class' like this:

{
  label: 'Delete',
  class: 'text-red-500',
  icon: 'i-lucide-trash-2',
  iconClass: 'text-red-500',
  click: () => {}
}

But it doesn't work after updating to 2.11.1, (only iconClass works), is this normal or a bug?

Before:
Capture d’écran 2023-12-23 à 20 17 25

After (In 2.11.1):
Capture d’écran 2023-12-23 à 19 47 56

Additional context

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions