It’s going to look something like this, it’s going to be all by default, so I can switch to mine, and I can display the table data, and nine times out of ten, the table will have a pager, and when I switch between different states, the table data switch, and of course the pager display is also important, so when I switch, I want to show the first page.

If the state switch event is A, clicking on A will call the ALL(ALL) or MySelf(my) event. To prevent these two events from being called in other functions, we can write A function B dedicated to the state switch.

A(){a. Data clearing b.his.currentPage =1
  c. other
  this.B()
}

B(){toggle ALL? ALL() : MySelf() }Copy the code