Skip to content

Conversation

@blalan05
Copy link
Member

@blalan05 blalan05 commented Jan 30, 2023

markup

<template>
  <v-app>
    <div class="ma-4">
      <v-list>
        <v-list-item prependIcon="mdi-vuetify" @click:prepend="clickIcon(1)" @click="clickItem(1)" appendAvatar="https://cdn.vuetifyjs.com/images/lists/1.jpg" @click:append="clickAvatar(1)">List Item 1</v-list-item>
        <v-list-item prependIcon="mdi-vuetify" @click:prepend="clickIcon(2)" @click="clickItem(2)" appendAvatar="https://cdn.vuetifyjs.com/images/lists/2.jpg" @click:append="clickAvatar(2)">List Item 2</v-list-item>
        <v-list-item prependIcon="mdi-vuetify" @click:prepend="clickIcon(3)" @click="clickItem(3)" appendAvatar="https://cdn.vuetifyjs.com/images/lists/3.jpg" @click:append="clickAvatar(3)">List Item 3</v-list-item>
      </v-list>
    </div>
  </v-app>
</template>

<script>
  export default {
    data: () => ({}),
    methods: {
      clickAvatar: (msg) => { console.log(`Avatar Clicked: ${msg}`)},
      clickIcon: (msg) => { console.log(`Icon Clicked: ${msg}`)},
      clickItem: (msg) => { console.log(`Item Clicked: ${msg}`)},
    },
  }
</script>

@blalan05 blalan05 self-assigned this Jan 30, 2023
@blalan05 blalan05 requested a review from johnleider January 30, 2023 03:58
@blalan05 blalan05 force-pushed the feat/list-click-events branch from c27b241 to e7c37a3 Compare January 30, 2023 04:32
@KaelWD KaelWD changed the base branch from next to master February 5, 2023 14:25
@KaelWD
Copy link
Member

KaelWD commented Mar 7, 2023

I think the idea was that if you want to do anything more than the default you should use the slot instead.

@blalan05
Copy link
Member Author

blalan05 commented Mar 7, 2023

It does match VTextField, which as these handlers.

@johnleider
Copy link
Member

I think this should probably add these events as props similar to our input components:

'onClick:prependInner': EventProp,

'onClick:prepend': EventProp,

@blalan05 blalan05 changed the base branch from master to dev March 31, 2023 14:58
@johnleider johnleider added this to the v3.x.x milestone May 17, 2023
@johnleider johnleider marked this pull request as draft July 24, 2023 19:52
@MajesticPotatoe MajesticPotatoe added the T: feature A new feature label Aug 14, 2023
@blalan05
Copy link
Member Author

blalan05 commented Mar 1, 2025

Updated to use props, and match VInputs use of InputIcon

@blalan05 blalan05 marked this pull request as ready for review March 1, 2025 06:31
@johnleider
Copy link
Member

Ideally we should abstract this functionality into something reusable to avoid duplication.

@johnleider johnleider added the S: has merge conflicts The pending Pull Request has merge conflicts label May 13, 2025
@johnleider johnleider marked this pull request as draft May 13, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: VListItem 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.

5 participants