Pagination in Lightning Web Component with Component Event

Updated: Jan 17, 2020

We have done this in Aura components, let's see how it's done in LWC.


First create a Lightning web component to fire the navigation events. Let's name this

paginationNavigation



paginationNavigation.js-meta.xml

This component have two buttons Previous and Next, and both will fire two separate events. Now these event needs to be handled in component, where we want to consume/handle these events.


Let's create another component 'accountListView'.


we have added paginationNavigation cmp in accountListView cmp, and defined the handlers for both the event.