Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(VList): restore example for advanced action use #20374

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

J-Sek
Copy link
Contributor

@J-Sek J-Sek commented Aug 22, 2024

Description

Adapted example for so called "action stack".

  • I wish it would not require so many margin and text color tweaks reduced to just 2 margin tweaks
  • I had to override line-clamp for subtitle, because it follows lines='...' prop – is it a bug or intended behavior? replaced lines='two' with py-3

Markup:

<template>
  <v-card class="mx-auto" max-width="500">
    <v-toolbar color="pink">
      <v-btn icon="mdi-menu"></v-btn>
      <v-toolbar-title>Inbox</v-toolbar-title>
      <v-spacer></v-spacer>
      <v-btn icon="mdi-magnify"></v-btn>
      <v-btn icon="mdi-checkbox-marked-circle"></v-btn>
    </v-toolbar>

    <v-list v-model:selected="selected" select-strategy="leaf">
      <v-list-item
        v-for="item in items"
        :key="item.id"
        :value="item.id"
        class="py-3"
        active-class="text-pink"
      >
        <v-list-item-title>{{ item.title }}</v-list-item-title>
        <v-list-item-subtitle class="mb-1 text-high-emphasis opacity-100">{{ item.headline }}</v-list-item-subtitle>
        <v-list-item-subtitle class="text-high-emphasis">{{ item.subtitle }}</v-list-item-subtitle>
        <template v-slot:append="{ isSelected }">
          <v-list-item-action class="flex-column align-end">
            <small class="mb-4 text-high-emphasis opacity-60">{{ item.action }}</small>
            <v-spacer></v-spacer>
            <v-icon v-if="isSelected" color="yellow-darken-3">mdi-star</v-icon>
            <v-icon v-else class="opacity-30">mdi-star-outline</v-icon>
          </v-list-item-action>
        </template>
      </v-list-item>
    </v-list>
  </v-card>
</template>

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

  const items = [
    { id: 1, action: '15 min', headline: 'Brunch this weekend?', subtitle: `I'll be in your neighborhood doing errands this weekend. Do you want to hang out?`, title: 'Ali Connors' },
    { id: 2, action: '2 hr', headline: 'Summer BBQ', subtitle: `Wish I could come, but I'm out of town this weekend.`, title: 'me, Scrott, Jennifer' },
    { id: 3, action: '6 hr', headline: 'Oui oui', subtitle: 'Do you have Paris recommendations? Have you ever been?', title: 'Sandra Adams' },
    { id: 4, action: '12 hr', headline: 'Birthday gift', subtitle:   'Have any ideas about what we should get Heidi for her birthday?', title: 'Trevor Hansen' },
    { id: 5, action: '18hr', headline: 'Recipe to try', subtitle: 'We should eat this: Grate, Squash, Corn, and tomatillo Tacos.', title: 'Britta Holt' },
  ]

  const selected = ref([2])
</script>

@J-Sek J-Sek marked this pull request as draft August 22, 2024 11:39
@KaelWD KaelWD force-pushed the master branch 3 times, most recently from 4c970f9 to 6a3285f Compare September 3, 2024 18:11
@MajesticPotatoe MajesticPotatoe changed the title chore: restore example for advanced VList action use docs(VList): restore example for advanced action use Oct 28, 2024
@MajesticPotatoe MajesticPotatoe added T: documentation C: VList VList S: has merge conflicts The pending Pull Request has merge conflicts labels Oct 28, 2024
@J-Sek J-Sek marked this pull request as ready for review October 29, 2024 12:30
@J-Sek
Copy link
Contributor Author

J-Sek commented Nov 4, 2024

Merge conflicts has been resolved

@J-Sek J-Sek removed the S: has merge conflicts The pending Pull Request has merge conflicts label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants