-
Notifications
You must be signed in to change notification settings - Fork 1
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
add option to display blank rows to fill to paginated number #9
Conversation
options.js
Outdated
@@ -3,5 +3,6 @@ export default { | |||
iconClasses: null, | |||
iconSide: '', | |||
searchWhen: 'onDelay', | |||
timeoutDelay: 1000 | |||
timeoutDelay: 1000, | |||
showEmpty: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this should default to false as it isn't really a function that makes sense to use in most cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woops, I meant to do that. I was just testing that it worked
@@ -98,6 +99,11 @@ | |||
default: true | |||
}, | |||
|
|||
showEmpty: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add docs to this. Its kind of a confusing functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would add the docs into the README with everything else, that way it's all in one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please bump the version number in the package.json as well
@@ -98,6 +99,11 @@ | |||
default: true | |||
}, | |||
|
|||
showEmpty: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would add the docs into the README with everything else, that way it's all in one place.
components/Table.vue
Outdated
@@ -261,7 +267,19 @@ | |||
this.loading = true; | |||
axios.get(url, { params: this.defaultParams }) | |||
.then(response => { | |||
this.tableData = response.data.data; | |||
if (this.showEmpty && response.data.data.length < this.paginate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be safer to do a check on the response.data && response.data.data. I know this wasn't in here before, but would be useful.
components/Table.vue
Outdated
...new Array(this.paginate - response.data.data.length).fill(blank) | ||
] | ||
} else { | ||
this.tableData = response.data.data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above comment
No description provided.