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

chore(Table): pass row index to table cell #291

Merged
merged 2 commits into from
Jun 19, 2023

Conversation

TomSmith27
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Jun 14, 2023

@TomSmith27 is attempting to deploy a commit to the Nuxt Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

Do you have an example of using this?

@TomSmith27
Copy link
Contributor Author

TomSmith27 commented Jun 15, 2023

So i am currently moving away from the bootstrap-vue project and they provide this option, I'm currently using it to display the position of a user in a football league table
image
image

I realise I could do something like

<UTable v-model="selected" :rows="people">
  <template #name-data="{ item }">
    {{ people.findIndex((p) => item.id == p.id) + 1 }}
  </template>
</UTable>

But when the index is already available i thought may aswell pass it through, + the component can know the order post sorting and filtering

image
https://bootstrap-vue.org/docs/components/table#component-reference

@atinux
Copy link
Member

atinux commented Jun 16, 2023

What about index instead of row-index?

@benjamincanac benjamincanac changed the title Pass row index to table cell chore(Table): pass row index to table cell Jun 19, 2023
@benjamincanac benjamincanac merged commit 13dba04 into nuxt:dev Jun 19, 2023
1 check passed
@TomSmith27
Copy link
Contributor Author

@benjamincanac thanks for sorting I'm away this week so haven't being able to make changes

benjamincanac added a commit that referenced this pull request Jun 21, 2023
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
benjamincanac added a commit that referenced this pull request Jun 21, 2023
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants