From 0ad19bbcfd76b32e941286b61c5f27225207cefb Mon Sep 17 00:00:00 2001 From: Duong Truong Phong Date: Fri, 5 Jul 2024 15:30:58 +0700 Subject: [PATCH] phongdt:fix paging --- .../templates/sections/articles/Default.vue | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/components/dynamic-page/page-component/templates/sections/articles/Default.vue b/components/dynamic-page/page-component/templates/sections/articles/Default.vue index ff7cbf4..52343ae 100644 --- a/components/dynamic-page/page-component/templates/sections/articles/Default.vue +++ b/components/dynamic-page/page-component/templates/sections/articles/Default.vue @@ -69,9 +69,6 @@ const handleRouteChange = async (query: any) => { } }; -onBeforeMount(() => { - if (route.query[`cpn_${_props.component?.id}`]) handleRouteChange(route.query); -}); const loadPage = async (page: number) => { let newDataQuery = ""; @@ -92,6 +89,8 @@ const loadPage = async (page: number) => { } }; +if (route.query[`cpn_${_props.component?.id}`]) handleRouteChange(route.query); + const handleNextPrev = (type: "+" | "-") => { if (listArticleByCategory.value?.length > 0) { if (type === "+") { @@ -128,25 +127,11 @@ const mapActivesToItems = (index: number) => {
- - - - - + {{ index + 1 }} - - - - - +