spatie / vue-table-component

A straight to the point Vue component to display tables
http://vue-table-component.spatie.be
MIT License
588 stars 149 forks source link

[Bug] Vue plugin install hook doesn't work for showCaption and showFilter #149

Closed binarykiwi closed 5 years ago

binarykiwi commented 6 years ago

Hej, thanks for this good work and very useful component. I like to predefine some pops using the Vue plugin install hook. But for somehow this does not work for all pops. I tried this ones:

import TableComponent from 'vue-table-component';
Vue.use(TableComponent, {
  showCaption: false,
  showFilter: false
});

But with no effect.

Adding the pop direct in the code works:

  <table-component class="pure-form"
    :show-caption="false"

Side note: the caption cannot be customized and translated which makes it unusable for me.

goyne commented 6 years ago

Same for me with both props.

piyushbeli commented 6 years ago

There is a bug in the module so showFiler and showOptions will not work this way. They have not defined the data type of those 2 props in the module definition so those are considered as String. If you provide false then it will be treated as "false" string which is a truthy value. I found a workaround after looking at the module code. Instead of passing false pass empty string "" so it will be tested as falsy and those options will start working.

freekmurze commented 5 years ago

We don't use this package anymore in our own projects and cannot justify the time needed to maintain it anymore. That's why we have chosen to abandon it. Feel free to fork our code and maintain your own copy or use one of the many alternatives.