Inject native router only in reactive scopes (#1730)

This commit is contained in:
Sasha Sorokin
2024-06-15 14:27:38 +02:00
committed by GitHub
parent 61fd6f1741
commit bd49d6bd89
12 changed files with 17 additions and 21 deletions

View File

@@ -574,6 +574,8 @@ const pageCount = computed(() =>
results.value ? Math.ceil(results.value.total_hits / results.value.limit) : 1
)
const router = useNativeRouter()
function onSearchChange(newPageNumber) {
noLoad.value = true
@@ -586,7 +588,6 @@ function onSearchChange(newPageNumber) {
refreshSearch()
if (process.client) {
const router = useRouter()
const obj = getSearchUrl((currentPage.value - 1) * maxResults.value, true)
router.replace({ path: route.path, query: obj })
}