mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-21 15:09:43 +00:00
feature:
[删除旧分页page.js]保留滚动分页; 修复搜索页不重置bug;
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from 'react'
|
||||
import { useLocale } from '@/lib/locale'
|
||||
import Router, { useRouter } from 'next/router'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
const SearchInput = ({ currentTag }) => {
|
||||
const locale = useLocale()
|
||||
@@ -8,12 +8,12 @@ const SearchInput = ({ currentTag }) => {
|
||||
const [searchValue, setSearchValue] = useState('')
|
||||
const handleSearch = () => {
|
||||
if (searchValue && searchValue !== '') {
|
||||
Router.push({ pathname: '/page/1', query: { s: searchValue } }).then(r => {
|
||||
console.log(r)
|
||||
router.push({ pathname: '/', query: { s: searchValue } }).then(r => {
|
||||
router.reload()
|
||||
})
|
||||
} else {
|
||||
Router.push({ pathname: '/' }).then(r => {
|
||||
console.log(r)
|
||||
router.push({ pathname: '/' }).then(r => {
|
||||
router.reload()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user