Skip to content

Conversation

@nekosaur
Copy link
Member

@nekosaur nekosaur commented Feb 2, 2023

Description

adds prop to open items on mount, either selected or all items.

Markup:

<template>
  <v-card
    class="mx-auto"
    width="300"
  >
    <v-list v-model:selected="selected" v-model:opened="open" open-on-mount="selected" select-strategy="multiple">
      <v-list-item prepend-icon="mdi-home" title="Home"></v-list-item>

      <v-list-group value="Users">
        <template v-slot:activator="{ props }">
          <v-list-item
            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
              v-bind="props"
              title="Admin"
            ></v-list-item>
          </template>

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

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

          <v-list-item
            v-for="([title, icon], i) in cruds"
            :key="i"
            :value="title"
            :title="title"
            :prepend-icon="icon"
          ></v-list-item>
        </v-list-group>
      </v-list-group>
    </v-list>
  </v-card>
</template>
<script>
  export default {
    data: () => ({
      selected: ['Settings', 'Read'],
      open: [],
      admins: [
        ['Management', 'mdi-account-multiple-outline'],
        ['Settings', 'mdi-cog-outline'],
      ],
      cruds: [
        ['Create', 'mdi-plus-outline'],
        ['Read', 'mdi-file-outline'],
        ['Update', 'mdi-update'],
        ['Delete', 'mdi-delete'],
      ],
    }),
  }
</script>

@nekosaur nekosaur added this to the v3.2.0 (Orion) milestone Feb 2, 2023
@nekosaur nekosaur self-assigned this Feb 2, 2023
@johnleider johnleider self-requested a review February 3, 2023 00:51
@johnleider johnleider added T: feature A new feature E: nested Nested composable labels Feb 3, 2023
@nekosaur nekosaur force-pushed the feat/nested-open-on-mount branch from 50c1ca1 to c691646 Compare March 15, 2023 18:04
@johnleider
Copy link
Member

Code looks good. My only issue is with the entry animation:

nested

@johnleider johnleider modified the milestones: v3.2.0 (Orion), v3.x.x Apr 25, 2023
@johnleider johnleider added the S: has merge conflicts The pending Pull Request has merge conflicts label Jun 19, 2023
@johnleider johnleider marked this pull request as draft September 19, 2023 13:05
@KaelWD KaelWD force-pushed the dev branch 2 times, most recently from 6331ca7 to 564ccc8 Compare September 10, 2025 13:29
@J-Sek J-Sek force-pushed the dev branch 3 times, most recently from a7fa817 to 2e2cddb Compare October 8, 2025 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

E: nested Nested composable S: has merge conflicts The pending Pull Request has merge conflicts T: feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants