Skip to content

Conversation

@J-Sek
Copy link
Contributor

@J-Sek J-Sek commented Oct 26, 2025

fixes #20895

Markup:

<template>
  <v-app theme="dark">
    <v-card class="mx-auto" width="300">
      <v-list nav v-model:opened="open">
        <v-list-item border prepend-icon="mdi-home" title="Home"></v-list-item>

        <v-list-group value="Users">
          <template v-slot:activator="{ props }">
            <v-list-item
              border
              v-bind="props"
              prepend-icon="mdi-account-circle"
              title="Users"
            ></v-list-item>
          </template>

          <v-list-group value="Admin">
            <template v-slot:activator="{ props }">
              <v-list-item border v-bind="props" title="Admin"></v-list-item>
            </template>

            <v-list-item
              border
              v-for="([title, icon], i) in admins"
              :key="i"
              :prepend-icon="icon"
              :title="title"
              :value="title"
            ></v-list-item>
          </v-list-group>

          <v-list-group value="Actions">
            <template v-slot:activator="{ props }">
              <v-list-item border v-bind="props" title="Actions"></v-list-item>
            </template>

            <v-list-item
              border
              v-for="([title, icon], i) in cruds"
              :key="i"
              :prepend-icon="icon"
              :title="title"
              :value="title"
            ></v-list-item>
          </v-list-group>
        </v-list-group>
      </v-list>
    </v-card>
  </v-app>
</template>

<script setup>
  import { ref } from 'vue'

  const open = ref(['Users'])

  const admins = [
    ['Management', 'mdi-account-multiple-outline'],
    // ['Settings', 'mdi-cog-outline'],
  ]
  const cruds = [
    ['Create', 'mdi-plus-outline'],
    ['Read', 'mdi-file-outline'],
    ['Update', 'mdi-update'],
    ['Delete', 'mdi-delete'],
  ]
</script>

@J-Sek J-Sek requested a review from johnleider October 26, 2025 16:43
@J-Sek J-Sek self-assigned this Oct 26, 2025
@J-Sek J-Sek added T: bug Functionality that does not work as intended/expected C: VList labels Oct 26, 2025
@J-Sek J-Sek force-pushed the jsek/vlist-spacing branch 2 times, most recently from 7cf1763 to ef04c63 Compare October 26, 2025 17:08
@J-Sek J-Sek force-pushed the jsek/vlist-spacing branch from ef04c63 to 77c16ce Compare October 26, 2025 17:12
@johnleider
Copy link
Member

Wouldn't this be easier if we switched to using flex/flex-gap for spacing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: VList T: bug Functionality that does not work as intended/expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report][3.7.7] VList with nav prop: VListItem spacing issue when only child

3 participants