【发布时间】:2020-12-10 19:13:22
【问题描述】:
帮帮我․․․我使用next js,浅路由...这两个代码来自两个不同的页面...我想在不渲染的情况下更改页面...第一个可以工作,但是第二个不工作...有什么问题吗在路径名中...
const showFileType = async () => {
await setFileType(type)
await router.push({
pathname: '/all-files',
query: {
fileType: type
}
}, undefined, {shallow: true})
}
const showAuthorImageType = async () => {
await setAuthorImageType(type)
await router.push({
pathname: `/authors/${router.query.author}`,
query: {
authorImageType: type
}
}, undefined, {shallow: true})
}
【问题讨论】: