diff --git a/components/haditha/search-page/SearchList.vue b/components/haditha/search-page/SearchList.vue index d909a49..10241d1 100644 --- a/components/haditha/search-page/SearchList.vue +++ b/components/haditha/search-page/SearchList.vue @@ -23,11 +23,18 @@ const router = useRouter(); function openModal(selectedItem) { // modal.open(SearchShow, { title: "Welcome" }); // isModalOpen.value = true; + + const slug = selectedItem._source.content.split(' ').filter((v,i)=>i<4).join('-'); + router.push({ name: "hadithaSearchShow", params: { - id: selectedItem._id, - slug: "no-slug", + id: selectedItem._source.id, + slug: slug, + }, + query: { + firstPage: 1, + page_count:props.total }, }); } diff --git a/pages/haditha/search/[id]/[slug]/index.vue b/pages/haditha/search/[id]/[slug]/index.vue index 952f81d..f0ec899 100644 --- a/pages/haditha/search/[id]/[slug]/index.vue +++ b/pages/haditha/search/[id]/[slug]/index.vue @@ -228,10 +228,14 @@ const handlePagination = (prevNextIndicator: string) => { .getRequest(url) .then((res) => { state.selectedItem = res.hits.hits?.[0]; + page_num.value = res.hits.hits[0]._source.address.page_num ?? 1; }) .finally(() => (loading.value = false)); }; - +const page_num = ref(1); +const handlePageChange = () => { + handlePagination(1, page_num.value); +}; // const localCopyTextToClipboard = (text: string) => { // copyTextToClipboard(text); // }; @@ -413,24 +417,24 @@ const handlePagination = (prevNextIndicator: string) => {