vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

feat(VPagination): Add page-data attribute to v-pagination

Open lBeJIuk opened this issue 2 years ago • 3 comments

Description

Add page-data attribute to v-pagination

Motivation and Context

While hovering over pages, i need to know, what page i'm hovering (page changing while drag'n'drop).

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] 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:

  • [x] The PR title is no longer than 64 characters.
  • [x] 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).
  • [x] My code follows the code style of this project.
  • [x] I've added relevant changes to the documentation (applies to new features and breaking changes in core library)

lBeJIuk avatar Jul 02 '22 09:07 lBeJIuk

There may be a use-case for this, but it would need to support adding any data- attribute. Couldn't you use the item slot and manually add it to the v-btn?

<v-pagination>
  <template #item="{ page, props }">
    <v-btn :data-page="page" v-bind="props">{{ item.page }}</v-btn>
  </template>
</v-pagination>

johnleider avatar Jul 26 '22 14:07 johnleider

Yes, I can try that. But what do you mean with "any data- attribute"? Do you want to add custom data attributes from item based on some configuration?

lBeJIuk avatar Jul 26 '22 14:07 lBeJIuk

data- attributes can be anything, and we wouldn't want to add more proprietary values such as data-test without some thought to it.

With that being said, the above should be sufficient for your use-case. If not, please report back.

johnleider avatar Jul 26 '22 14:07 johnleider

This Pull Request is being closed due to inactivity.

If you have any additional questions, please reach out to us in our Discord community.

johnleider avatar Aug 23 '22 14:08 johnleider