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

feat(VWindow,VCarousel): **prev** and **next** slots #12602

Merged
merged 4 commits into from
Nov 17, 2020

Conversation

jacekkarczmarczyk
Copy link
Member

@jacekkarczmarczyk jacekkarczmarczyk commented Nov 12, 2020

Description

Adds slots for prev/next arrow

Motivation and Context

fixes partially #3235

How Has This Been Tested?

playground

Markup:

<template>
  <v-container>
    <v-window
      reverse
      show-arrows
    >
      <template #prev="{ on, attrs }">
        <v-btn
          color="success"
          v-bind="attrs"
          v-on="on"
        >Prev</v-btn>
      </template>
      <template #next="{ on, attrs }">
        <v-btn
          color="info"
          v-bind="attrs"
          v-on="on"
        >Next</v-btn>
      </template>
      <v-window-item
        v-for="n in 3"
        :key="`card-${n}`"
        class="pa-12"
      >Lorem ipsum</v-window-item>
    </v-window>

    <v-carousel>
      <template #prev="{ on, attrs }">
        <v-btn
          color="success"
          v-bind="attrs"
          v-on="on"
        >Prev</v-btn>
      </template>
      <template #next="{ on, attrs }">
        <v-btn
          color="info"
          v-bind="attrs"
          v-on="on"
        >Next</v-btn>
      </template>
      <v-carousel-item
        v-for="i in 6"
        :key="i"
      >
        <div class="black--text">
          Slide {{ i + 1 }}
        </div>
      </v-carousel-item>
    </v-carousel>
  </v-container>
</template>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any features but makes things better)

Checklist:

  • The PR title is no longer than 64 characters.
  • The PR is submitted to the correct branch (master for bug fixes and documentation updates, dev for new features and backwards compatible changes and next for non-backwards compatible changes).
  • My code follows the code style of this project.
  • I've added relevant changes to the documentation (applies to new features and breaking changes in core library)

@jacekkarczmarczyk jacekkarczmarczyk added T: feature A new feature C: VCarousel VCarousel C: VWindow VWindow labels Nov 12, 2020
@jacekkarczmarczyk jacekkarczmarczyk added this to the v2.4.0 milestone Nov 12, 2020
@jacekkarczmarczyk jacekkarczmarczyk self-assigned this Nov 12, 2020
Copy link
Member

@nekosaur nekosaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to repeat the slot definition or translation. Add source: 'v-window' to the definition in maps/v-window.js and then re-use them in maps/v-carousel.js (same way as v-data-table map re-uses v-data-iterator slots). Then translation is only necessary for v-window.json

jacekkarczmarczyk and others added 2 commits November 12, 2020 22:35
Co-authored-by: Albert Kaaman <albert@kaaman.nu>
Co-authored-by: Albert Kaaman <albert@kaaman.nu>
nekosaur
nekosaur previously approved these changes Nov 12, 2020
KaelWD
KaelWD previously approved these changes Nov 13, 2020
@KaelWD
Copy link
Member

KaelWD commented Nov 13, 2020

This doesn't entirely resolve #3235 though, you still can't modify the delimiters.

@jacekkarczmarczyk jacekkarczmarczyk dismissed stale reviews from KaelWD and nekosaur November 13, 2020 12:20

delimiter slot on the way

@jacekkarczmarczyk
Copy link
Member Author

Adding delimiter slots needs some more decisions and would be done in a separate PR, i've updated description

fixes partially #3235

@KaelWD KaelWD merged commit a0140b0 into dev Nov 17, 2020
@KaelWD KaelWD deleted the feat/#3235-window-control-slots branch November 17, 2020 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VCarousel VCarousel C: VWindow VWindow T: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] add slots for v-carousel controls
3 participants