I\'m trying to use this https://github.com/matfish2/vue-tables-2 with Vue 2.1.8.
And it\'s working perfectly BUT I need to use custom filters to format some fields based
I found this lesson to help me the best. https://github.com/ratiw/vuetable-2-tutorial/wiki/lesson-13
Summary:
You should emit events with vue-events
package or compute properties with Vuex (recommended).
You want to use the :append-params="moreParams"
on vuetable which is a feature of vuetable2 that will append to api-url
along with pagination values (separate from these params).
I am using Vuex so I make moreParams a computed property of the vuetable. It uses this.$store.getters.moreParams
which is my Vuex getter as I have multiple search fields. This is reactive to my Vuex commits from input field handlers.
computed: {
moreParams() {
return this.$store.getters.moreParams
},
},
Otherwise you could use a $store.stage.property. I have a watch on moreParams which refreshes the table with the new query:
watch: {
moreParams(newVal, oldVal) {
this.$nextTick(() => {
this.$refs.vuetable.refresh()
})
},
},