Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.

Add slot support for footer #73

Merged
merged 2 commits into from
Nov 2, 2017

Conversation

samtsai
Copy link
Contributor

@samtsai samtsai commented Oct 26, 2017

While I understand your project has no use case for a summary row, I wanted to propose a very lightweight option to show tfoot data within a named slot. When not using the slot, it will add harmless <tfoot></tfoot> markup as I thought a hide/show option was unnecessary.

Commit message:
Add test for tfoot slot
Minor lint cleanup

Add test for `tfoot` slot
Minor lint cleanup
@sebastiandedeyne
Copy link
Member

I don't mind this, what do you think @freekmurze ?

Maybe we should pass some data to the footer template though, so you can compute things in there like total count?

@freekmurze
Copy link
Member

I'm ok with adding this. Passing all the data to the footer seems like a mighty fine idea.

@samtsai
Copy link
Contributor Author

samtsai commented Oct 26, 2017

Let me add these things, update docs and tests.

Update documentation and demo examples with `tfoot` slot usage.

Note: with later versions of `vue` we'll need to change the attribute
name from `scope` to `slot-scope`
@@ -38,6 +38,9 @@
:columns="columns"
></table-row>
</tbody>
<tfoot>
<slot name="tfoot" :rows="rows"></slot>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm passing rows as it seems to be the most useful information, but please suggest changes if there's a better property.

@samtsai
Copy link
Contributor Author

samtsai commented Oct 26, 2017

I've updated demo, documentation, change log and tests.

@samtsai
Copy link
Contributor Author

samtsai commented Nov 1, 2017

@sebastiandedeyne @freekmurze not exactly sure why tests are failing since I didn't change those areas. Looks like a similar issue with another PR (that's been closed #76 ) https://travis-ci.org/spatie/vue-table-component/builds/295341092

@sebastiandedeyne sebastiandedeyne merged commit 2896fed into spatie:master Nov 2, 2017
@sebastiandedeyne
Copy link
Member

Gonna merge this and take care of Travis myself, thanks!

@samtsai samtsai deleted the add-slot-support-for-tfoot branch November 2, 2017 16:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants