VueJS 2 Pagination + Table Hi anyone,
Is there someone who can turn this fiddle to VUEJS2?
https://jsfiddle.net/os7hp1cy/48/
I'm trying to create a pagination and table out of this fiddle but it is vuejs ver 1. there's something wrong in v-for
Hi,
Your problem is because of the filters used in the v-for
v-for="user in users | filterBy searchKey | paginate"
filters are removed in VueJS2
You have to make a computed property that filters the users and then iterate over this computed property.
computed: {
usersFilteredBySearchKey: function () {
const vm = this;
return _.filter(vm.users, function (user) {
return _.includes(user.name, vm.searchKey);
});
},
}
Hey @samfrjn11 , thanks but I tried it but still not working. Can you please give me a sample working fiddle? :)
@aareyes00 something like this:
https://jsfiddle.net/os7hp1cy/123/
Note that you still need to change something about the pagination, but with this it should give you a start. v-for range in vue 1 started with index 0, vue 2 starts at index 1
Please sign in or create an account to participate in this conversation.