fix: resolve admin pages pagination bug (#4280)
This commit is contained in:
		| @@ -61,6 +61,7 @@ | |||||||
|             sort-by='updatedAt', |             sort-by='updatedAt', | ||||||
|             sort-desc, |             sort-desc, | ||||||
|             hide-default-footer |             hide-default-footer | ||||||
|  |             @page-count="pageTotal = $event" | ||||||
|           ) |           ) | ||||||
|             template(slot='item', slot-scope='props') |             template(slot='item', slot-scope='props') | ||||||
|               tr.is-clickable(:active='props.selected', @click='$router.push(`/pages/` + props.item.id)') |               tr.is-clickable(:active='props.selected', @click='$router.push(`/pages/` + props.item.id)') | ||||||
| @@ -89,6 +90,7 @@ export default { | |||||||
|       selectedPage: {}, |       selectedPage: {}, | ||||||
|       pagination: 1, |       pagination: 1, | ||||||
|       pages: [], |       pages: [], | ||||||
|  |       pageTotal: 0, | ||||||
|       headers: [ |       headers: [ | ||||||
|         { text: 'ID', value: 'id', width: 80, sortable: true }, |         { text: 'ID', value: 'id', width: 80, sortable: true }, | ||||||
|         { text: 'Title', value: 'title' }, |         { text: 'Title', value: 'title' }, | ||||||
| @@ -108,9 +110,6 @@ export default { | |||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   computed: { |   computed: { | ||||||
|     pageTotal () { |  | ||||||
|       return Math.ceil(this.filteredPages.length / 15) |  | ||||||
|     }, |  | ||||||
|     filteredPages () { |     filteredPages () { | ||||||
|       return _.filter(this.pages, pg => { |       return _.filter(this.pages, pg => { | ||||||
|         if (this.selectedLang !== null && this.selectedLang !== pg.locale) { |         if (this.selectedLang !== null && this.selectedLang !== pg.locale) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user