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

[tables] Allow slots for empty result sets #387

Merged
merged 21 commits into from
May 12, 2017
Merged

[tables] Allow slots for empty result sets #387

merged 21 commits into from
May 12, 2017

Conversation

tmorehouse
Copy link
Member

@tmorehouse tmorehouse commented May 12, 2017

added two slots:

  • empty to be shown if no items (items.length === 0)
  • emptyFiltered to be shown if a filtered result (_items.length === 0) has no records

and one prop
showEmpty to enable showing the empty slots

One method to address issue #385

There might be better ways to do this though. comments/changes welcome.

@tmorehouse tmorehouse requested a review from pi0 May 12, 2017 06:15
@pi0 pi0 merged commit 2e2e809 into bootstrap-vue:master May 12, 2017
@bastones
Copy link

bastones commented May 10, 2018

It is not very clear in the documentation that the showEmpty prop MUST be set on the b-table component in order for the empty and emptyFiltered slots to work. Is this the case?

I'll be happy to update the documentation to make this clearer for others, but just want to double-check this is the intended behaviour.

@emanuelmutschlechner
Copy link
Contributor

emanuelmutschlechner commented May 11, 2018

I think documentation is fine. show-empty is listed in the "Component Reference" of <b-table> and its usage is shown in the "Complete Example".

@bastones
Copy link

bastones commented May 15, 2018

Is it too much hard work to add a few words to the row in the table under the "Slots" heading to make developers aware the empty and emptyfiltered slots won't work if the show-empty prop is not set?

I will be happy to do this myself and submit a pull request, but I stand by what I said - it is not clear and good documentation should be clear about technical behaviour. It is only after using the component and wasting time tracking down why the slot wasn't working that I now know why this happens: it's because I can see there is a default message that gets displayed which the empty-text prop or empty can replace, but again only if the show-empty prop is set.

@arippberger
Copy link

+1 for @bastones comment on adding info to the documentation. It doesn't make it clear show-empty needs to be set to true.

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.

None yet

5 participants